1 Fig 5 and Fig S8-9: Mouse-only statistical analysis

### Figure 5 - gnoto
##### Mouse plots, pre-processed data
library(data.table)
library(ggplot2)
library(ggrepel)
library(tidyverse)
## ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ tibble  3.1.7     ✔ dplyr   1.0.7
## ✔ tidyr   1.2.0     ✔ stringr 1.4.0
## ✔ readr   2.1.2     ✔ forcats 0.5.1
## ✔ purrr   0.3.4
## ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::between()   masks data.table::between()
## ✖ dplyr::filter()    masks stats::filter()
## ✖ dplyr::first()     masks data.table::first()
## ✖ dplyr::lag()       masks stats::lag()
## ✖ dplyr::last()      masks data.table::last()
## ✖ purrr::transpose() masks data.table::transpose()
library(ggpubr)
library(RColorBrewer)
library(patchwork)
library(broom)
theme_set(theme_classic2())
datadir <- "../GnotoDataMaggie/"
outdir <- "figure5/"
dir.create(outdir)

sessionInfo()
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.4 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] broom_0.8.0        patchwork_1.1.1    RColorBrewer_1.1-2 ggpubr_0.4.0      
##  [5] forcats_0.5.1      stringr_1.4.0      dplyr_1.0.7        purrr_0.3.4       
##  [9] readr_2.1.2        tidyr_1.2.0        tibble_3.1.7       tidyverse_1.3.1   
## [13] ggrepel_0.9.1      ggplot2_3.3.6      data.table_1.14.2 
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.8.3     lubridate_1.8.0  assertthat_0.2.1 digest_0.6.29   
##  [5] utf8_1.2.2       R6_2.5.1         cellranger_1.1.0 backports_1.2.1 
##  [9] reprex_2.0.1     evaluate_0.15    httr_1.4.2       pillar_1.7.0    
## [13] rlang_1.0.2      readxl_1.3.1     rstudioapi_0.13  car_3.0-13      
## [17] jquerylib_0.1.4  rmarkdown_2.14   munsell_0.5.0    compiler_4.1.1  
## [21] modelr_0.1.8     xfun_0.31        pkgconfig_2.0.3  htmltools_0.5.2 
## [25] tidyselect_1.1.2 fansi_1.0.3      crayon_1.4.1     tzdb_0.3.0      
## [29] dbplyr_2.1.1     withr_2.5.0      grid_4.1.1       jsonlite_1.8.0  
## [33] gtable_0.3.0     lifecycle_1.0.0  DBI_1.1.1        magrittr_2.0.3  
## [37] scales_1.1.1     carData_3.0-5    cli_3.3.0        stringi_1.7.6   
## [41] ggsignif_0.6.3   fs_1.5.0         xml2_1.3.2       bslib_0.3.1     
## [45] ellipsis_0.3.2   generics_0.1.0   vctrs_0.4.1      tools_4.1.1     
## [49] glue_1.6.2       hms_1.1.1        abind_1.4-5      fastmap_1.1.0   
## [53] yaml_2.3.5       colorspace_2.0-3 rstatix_0.7.0    rvest_1.0.2     
## [57] knitr_1.39       haven_2.5.0      sass_0.4.1
### Read in data
met_data <- fread("processedDatasets/mouse_intestinal_all_data.csv")
met_data_means <- fread("processedDatasets/mouse_intestinal_mean_summaries.csv")

sample_tab = unique(met_data[,list(Sample, SampleType, Group, Replicate, Animal, Cage)])[order(Sample)]

serum_met_data <- fread("processedDatasets/mouse_serum_all_data.csv")
serum_met_data_means <- fread("processedDatasets/mouse_serum_mean_summaries.csv")

# Sub PCAs on filtered data
met_good_wide = dcast(met_data[Duplicate ==0], Sample~IDUniq, value.var = "log10value")
met_mat = as.matrix(met_good_wide[,2:ncol(met_good_wide), with = F])
samp_pca = prcomp(met_mat)
pca_dat = data.table(samp_pca$x)
pca_dat[,Sample:=met_good_wide[,Sample]]
pca_dat = merge(pca_dat, sample_tab, by = "Sample", all.x = T)
pc_vals = round((samp_pca$sdev[1:4])^2/sum((samp_pca$sdev^2))*100, digits = 2)

group_colors = c("gray80", RColorBrewer::brewer.pal(3, "Set1"))
names(group_colors) = c("GF", c("2243", "15644", "AB12n2")) 


#LI
samp_pca = prcomp(met_mat[which(grepl("LI", met_good_wide[,Sample])),])
pca_dat = data.table(samp_pca$x)
pca_dat[,Sample:=met_good_wide[grepl("LI",Sample),Sample]]
pca_dat = merge(pca_dat, sample_tab, by = "Sample", all.x = T)
pc_var <- round(100*summary(samp_pca)$importance[2,c(1:2)], digits = 1)
pca_dat[,Group:=gsub("El", "", Group)]

pca_plot1b_li = ggplot(pca_dat, aes(x=PC1, y = PC2, fill = Group)) + geom_point(size = 3, shape = 21) +  scale_fill_manual(values = group_colors) + ggtitle("Colon") + theme(legend.position = "right") + xlab(paste0("PC1 (", pc_var[1], "%)")) + ylab(paste0("PC2 (", pc_var[2], "%)"))


#Cecal
samp_pca = prcomp(met_mat[which(grepl("Cecal", met_good_wide[,Sample])),])
pca_dat = data.table(samp_pca$x)
pca_dat[,Sample:=met_good_wide[grepl("Cecal",Sample),Sample]]
pca_dat = merge(pca_dat, sample_tab, by = "Sample", all.x = T)
pc_var <- round(100*summary(samp_pca)$importance[2,c(1:2)], digits = 1)
pca_dat[,Group:=gsub("El", "", Group)]
pca_plot1b_cecal = ggplot(pca_dat, aes(x=PC1, y = PC2, fill = Group)) + geom_point(size = 3, shape = 21) +  scale_fill_manual(values = group_colors) + ggtitle("Cecum") + theme(legend.position = "right") + xlab(paste0("PC1 (", pc_var[1], "%)")) + ylab(paste0("PC2 (", pc_var[2], "%)"))

#SI
samp_pca = prcomp(met_mat[which(grepl("SI", met_good_wide[,Sample])),])
pca_dat = data.table(samp_pca$x)
pca_dat[,Sample:=met_good_wide[grepl("SI",Sample),Sample]]
pca_dat = merge(pca_dat, sample_tab, by = "Sample", all.x = T)
pc_var <- round(100*summary(samp_pca)$importance[2,c(1:2)], digits = 1)
pca_dat[,Group:=gsub("El", "", Group)]
pca_plot1b_si = ggplot(pca_dat, aes(x=PC1, y = PC2, fill = Group)) + geom_point(size = 3, shape = 21) +  scale_fill_manual(values = group_colors) + ggtitle("Ileum") + theme(legend.position = "right") + xlab(paste0("PC1 (", pc_var[1], "%)")) + ylab(paste0("PC2 (", pc_var[2], "%)"))


## Serum
met_good_wide = dcast(serum_met_data[!Group %in% c("bk", "pool") & Duplicate == 0], Sample~IDUniq, value.var = "log10value")
met_mat = as.matrix(met_good_wide[,2:ncol(met_good_wide), with = F])
samp_pca = prcomp(met_mat)
pca_dat = data.table(samp_pca$x)
sample_tab <- unique(serum_met_data[,list(Sample, Group, Cage)])
pca_dat[,Sample:=met_good_wide[,Sample]]
pca_dat = merge(pca_dat, sample_tab, by = "Sample", all.x = T)

pc_var <- round(100*summary(samp_pca)$importance[2,c(1:2)], digits = 1)

pca_dat[,Group:=gsub("El", "", Group)]
pca_plot1b_serum = ggplot(pca_dat, aes(x=PC1, y = PC2, fill = Group)) + geom_point(size = 3, shape = 21) +  scale_fill_manual(values = group_colors) + ggtitle("Serum") + theme(legend.position = "right") + xlab(paste0("PC1 (", pc_var[1], "%)")) + ylab(paste0("PC2 (", pc_var[2], "%)"))

pca_all <- pca_plot1b_si + guides(fill = "none")+pca_plot1b_cecal+ guides(fill = "none")+pca_plot1b_li+ guides(fill = "none")+pca_plot1b_serum + plot_layout(nrow = 1)

ggsave(pca_all, file = paste0(outdir, "pca_plots_all_sites.pdf"), width = 10, height = 2.5)

pca_all

####### Volcano plot
gnps_color_scale <- brewer.pal(10, "Set3")[c(1:9)]
names(gnps_color_scale) <- c(met_data_means[CF_superclass != "no matches", sort(unique(CF_superclass))], "no matches")
met_data_means[,Site:=factor(Site, levels = c("Ileum", "Cecum", "Colon"))]
met_data_means[,Strain:=factor(Group, levels = c("GF", "2243", "15644", "AB12n2"))]
met_data_means[,EstimateLog2Scale:=log2(10^Estimate)]

mouse_volcano_plot2_gnps <- ggplot(met_data_means[CF_superclass == "no matches" & !is.na(Site) & Group != "GF"], 
                                   aes(x = EstimateLog2Scale, y = -1*log10(FDRCorrect), fill = CF_superclass)) + geom_hline(yintercept = 0.7, linetype = 2) + 
  geom_vline(xintercept = -0.3, linetype = 2) + geom_vline(xintercept = 0.3, linetype = 2) + 
  theme(legend.position = "right", strip.background = element_blank(), panel.border = element_rect(color = "black", fill = NA)) + geom_point(shape = 21, size = 1.5, alpha = 0.7) + 
  facet_grid(Strain~Site) + geom_point(data = met_data_means[CF_superclass != "no matches"& !is.na(Site) & Group != "GF"], shape = 21, size = 1.5) +
  scale_fill_manual(values = gnps_color_scale) + ylab("-log10(corrected p-value)") + 
  geom_text_repel(aes(label = MetName), data = met_data_means[MetName != "Unknown" & (log10(FDRCorrect) < -7|abs(Estimate) > 3)], 
                  size = 2, max.overlaps = 3) + xlab("log2FC estimate vs GF")

serum_met_data_means[,Strain:=factor(gsub("El", "", Group), levels = c("GF", "2243", "15644", "AB12n2"))]
serum_met_data_means[,EstimateLog2Scale:=log2(10^estimate)]
serum_volc_plot_gnps <- ggplot(serum_met_data_means[CF_superclass=="no matches" & Group != "GF"], 
                               aes(x = EstimateLog2Scale, y = -1*log10(FDRCorrect),fill = CF_superclass)) + geom_hline(yintercept = 0.7, linetype = 2) + 
  geom_vline(xintercept = -0.3, linetype = 2) + geom_vline(xintercept = 0.3, linetype = 2) + facet_grid(rows = vars(Strain)) +
  theme(legend.position = "right", strip.background = element_blank(), panel.border = element_rect(color = "black", fill = NA)) + geom_point(shape = 21) + 
  geom_point(data = serum_met_data_means[Group == "El2243"  & CF_superclass!="no matches"], size = 1.5, shape = 21)  + 
  scale_fill_manual(values = gnps_color_scale) + ylab("-log10(corrected p-value)")  + xlab("log2FC estimate vs GF") 


combined_volc <- mouse_volcano_plot2_gnps + guides(fill = "none") + serum_volc_plot_gnps + plot_layout(widths = c(3, 1), guides = "collect")

ggsave(combined_volc, file = paste0(outdir, "combined_volcano_plot.pdf"), width = 11, height = 5.5)

combined_volc

met_data_means[!is.na(FDRCorrect),sum(FDRCorrect < 0.2), by = IDUniq][,table(V1 > 0)]
## 
## FALSE  TRUE 
## 16426  3288
met_data_means[!is.na(FDRCorrect),sum(FDRCorrect < 0.2), by = list(IDUniq, Site)][,prop.table(table(Site, V1 > 0), 1)]
##        
## Site         FALSE       TRUE
##   Ileum 0.98397078 0.01602922
##   Cecum 0.91889013 0.08110987
##   Colon 0.88454905 0.11545095
serum_met_data_means[!is.na(FDRCorrect), sum(FDRCorrect < 0.2), by = IDUniq][,table(V1 > 0)]
## 
## FALSE  TRUE 
##  5066    21
serum_met_data_means[FDRCorrect < 0.2, list(IDUniq, CF_superclass)]
##                       IDUniq CF_superclass
##  1:     73.0284_6.761_26_Neg    no matches
##  2:     73.0284_6.761_26_Neg    no matches
##  3:    82.95307_1.225_48_Neg    no matches
##  4:    84.95013_1.226_53_Neg    no matches
##  5:    88.03939_4.537_79_Neg    no matches
##  6:  117.01817_8.068_251_Neg    no matches
##  7:  117.01817_8.068_251_Neg    no matches
##  8:   117.0182_6.756_253_Neg    no matches
##  9:   117.0182_6.756_253_Neg    no matches
## 10:   117.0182_6.756_253_Neg    no matches
## 11:   130.0499_4.537_327_Neg    no matches
## 12:  192.06537_6.767_835_Neg    no matches
## 13:  192.06537_6.767_835_Neg    no matches
## 14:  192.06537_6.767_835_Neg    no matches
## 15: 345.13693_4.742_1730_Neg    no matches
## 16:  465.30383_1.12_1926_Neg    no matches
## 17: 155.10585_1.104_1091_pos    no matches
## 18:  181.1212_1.071_1454_pos    no matches
## 19:  181.1212_1.071_1454_pos    no matches
## 20: 207.07928_6.763_1816_pos    no matches
## 21: 295.16516_5.806_2918_pos    no matches
## 22: 316.16547_8.609_3107_pos    no matches
## 23: 316.16547_8.609_3107_pos    no matches
## 24: 316.16547_8.609_3107_pos    no matches
## 25: 320.20578_5.307_3146_pos    no matches
## 26: 326.14407_6.291_3177_pos    no matches
## 27:  348.23727_4.93_3344_pos    no matches
## 28: 418.19223_8.793_3710_pos    no matches
## 29: 440.17429_8.787_3814_pos    no matches
## 30: 672.42218_4.927_4389_pos    no matches
##                       IDUniq CF_superclass
##### Plot Arg, Orn, Citr, Agm, Putr
met_data[,Site:=case_when(
  SampleType == "Cecal" ~ "Cecum",
  SampleType == "LI" ~ "Colon",
  SampleType == "SI" ~ "Ileum"
)]
met_data[,Site:=factor(Site, levels = c("Ileum", "Cecum", "Colon"))]
met_data_means[,Site:=case_when(
  SampleType == "Cecal" ~ "Cecum",
  SampleType == "LI" ~ "Colon",
  SampleType == "SI" ~ "Ileum"
)]
met_data_means[,Site:=factor(Site, levels = c("Ileum", "Cecum", "Colon"))]

met_data[,Strain:=factor(Group, levels = c("GF", "2243", "15644", "AB12n2"))]

selected_mets <- c("Arginine", "Citrulline", "Ornithine", "Agmatine", "Putrescine")
met_data_sub <- met_data[MetName %in% selected_mets]
met_data_sub <- met_data_sub[!IDUniq %in% c("173.10324_9.473_1432_Negative","174.08743_8.807_1461_Negative")]
signif_tests <- met_data_means[IDUniq %in% met_data_sub[,IDUniq], list(IDUniq, MetName, Group, FDRCorrect, Site)]
signif_tests_sub <- signif_tests[,list(Group, FDRCorrect, MetName, Site)]
max_vals <- met_data_sub[,max(log10value), by=MetName]
signif_tests_sub <- merge(signif_tests_sub, max_vals, by = "MetName")
#setnames(signif_tests_sub, c("group1", "group2", "FDRCorrect", "MetName", "Site"))
setnames(signif_tests_sub, "Group", "Strain")
signif_tests_sub[,Strain:=factor(Strain, levels = c("GF", "2243", "15644", "AB12n2"))]
signif_tests_sub[,Site:=factor(Site, levels = c("Ileum", "Cecum", "Colon"))]
signif_tests_sub[,SignifCategory:=case_when(
  FDRCorrect < 0.1 & FDRCorrect > 0.05 ~ ".", 
  FDRCorrect < 0.05 & FDRCorrect > 0.01 ~ "*", 
  FDRCorrect < 0.01 & FDRCorrect > 0.001 ~ "**",
  FDRCorrect < 0.001 ~ "***", 
  TRUE ~ ""
)]

arg_plot <- ggplot(met_data_sub, aes(x = Site, y = log10value, color = Strain)) + 
  geom_boxplot(position = position_dodge(width = 0.8), outlier.shape = NA) + 
  geom_point(position = position_dodge(width = 0.8), shape = 21, aes(fill = Strain), color = "black") + 
  facet_wrap(~factor(MetName, levels = c("Arginine", "Citrulline", "Ornithine", "Agmatine", "Putrescine")), scales = "free_y") + 
  scale_color_manual(values = group_colors) + scale_fill_manual(values = group_colors) + 
  theme(axis.text = element_text(color= "black"), panel.background = element_rect(color = "black"), strip.background = element_blank()) + 
  ylab("log10 peak height") + scale_x_discrete(limits = c("Ileum", "Cecum", "Colon")) +
  geom_text(data = signif_tests_sub, aes(label = SignifCategory, y = V1+0.2, group = interaction(Strain, Site)), fontface = "bold", size = 2.6, position = position_dodge(width = 0.8))

ggsave(arg_plot, file = paste0(outdir, "arg_agm_withLmerStats.pdf"), width = 7.5, height = 4.5)

arg_plot

######## Make plot of all amino acids
amino_acids <- c("Alanine", "Arginine", "Asparagine","Aspartic acid", "Glutamic acid", "Glutamine", "Histidine", 
                 "Isoleucine", "Leucine", "Lysine", "Methionine", "Phenylalalanine", "Proline", "Serine", "Threonine", 
                 "Tryptophan", "Tyrosine", "Valine")
bad_ids <- met_data_means[MetName %in% 
                            met_data_means[MetName %in% amino_acids, length(unique(IDUniq)), by=MetName][V1==2, MetName] & IonMode == "Negative", unique(IDUniq)]

met_data_sub <- met_data[MetName %in% amino_acids & !IDUniq %in% bad_ids]
signif_tests <- met_data_means[IDUniq %in% met_data_sub[,IDUniq], list(IDUniq, MetName, Group, FDRCorrect, Site)]
signif_tests_sub <- signif_tests[,list(Group, FDRCorrect, MetName, Site)]
max_vals <- met_data_sub[,max(log10value), by=MetName]
signif_tests_sub <- merge(signif_tests_sub, max_vals, by = "MetName")
setnames(signif_tests_sub, "Group", "Strain")
signif_tests_sub[,Strain:=factor(Strain, levels = c("GF", "2243", "15644", "AB12n2"))]
signif_tests_sub[,Site:=factor(Site, levels = c("Ileum", "Cecum", "Colon"))]
signif_tests_sub[,SignifCategory:=case_when(
  FDRCorrect < 0.1 & FDRCorrect > 0.05 ~ ".", 
  FDRCorrect < 0.05 & FDRCorrect > 0.01 ~ "*", 
  FDRCorrect < 0.01 & FDRCorrect > 0.001 ~ "**",
  FDRCorrect < 0.001 ~ "***", 
  TRUE ~ ""
)]

aa_plot <- ggplot(met_data_means[!MetName %in% amino_acids & !is.na(Site) & Group != "GF"], 
       aes(x = EstimateLog2Scale, y = -1*log10(FDRCorrect))) + geom_hline(yintercept = 0.7, linetype = 2) + 
  geom_vline(xintercept = -0.3, linetype = 2) + geom_vline(xintercept = 0.3, linetype = 2) + 
  theme(legend.position = "right", strip.background = element_blank(), panel.border = element_rect(color = "black", fill = NA)) + 
  facet_grid(Strain~Site) + geom_point(data = met_data_means[MetName %in% amino_acids & !is.na(Site) & Group != "GF"], 
                                       shape = 21, size = 1.5, aes(fill = ifelse(MetName == "Arginine", "Arginine", "Other amino acids"))) + 
  scale_fill_brewer(palette = "Set2", name = "") + xlab("Log2 fold change estimate E. lenta colonized vs. GF") +
  ylab("-log10(corrected p-value)")

ggsave(aa_plot, file = paste0(outdir, "amino_acids_plot.pdf"), width = 5.5, height = 3.4)

aa_plot

2 Linking features across datasets

###################### Linking features across datasets
#rm(list = ls())
good_intest_features <- met_data[Duplicate == 0,sort(unique(paste0("Intestinal Contents_", AlignmentID, "_", ifelse(IonMode=="Negative", "Neg", "Pos"))))]
good_serum_features <- serum_met_data[Duplicate == 0, sort(unique(paste0("Serum_", AlignmentID, "_", ifelse(IonMode=="Neg", "Neg", "Pos"))))]

### Read in feature-linking results
all_pos_data <- readRDS(paste0(datadir, "allPosDataWithMergedIDs.rds"))
all_neg_data <- readRDS(paste0(datadir, "allNegDataWithMergedIDs.rds"))
focus_datasets <- c("GL", "Intestinal Contents", "Serum", "Pilot", "TimeCourse")
all_neg_data[Dataset == "Timecourse", Dataset:="TimeCourse"]
all_neg_data[Dataset == "Intestinal contents", Dataset:="Intestinal Contents"]
all_neg_data[,IDUniq:=gsub("Intestinal contents", "Intestinal Contents", IDUniq)]
all_neg_data[,IDUniq:=gsub("Timecourse", "TimeCourse", IDUniq)]
all_pos_data <- all_pos_data[Dataset %in% focus_datasets]
all_neg_data <- all_neg_data[Dataset %in% focus_datasets]

all_pos_data[!is.na(NewID),NewID2:=paste0(NewID, "_Pos")]
all_neg_data[!is.na(NewID),NewID2:=paste0(NewID, "_Neg")]

features_tab <- distinct(all_pos_data[,list(IDUniq, MSI, `Alignment ID`, `Average Rt(min)`, `Average Mz`, `Metabolite name`, INCHIKEY, `Adduct type`, Dataset, AvgMZ, AvgRt, NewID2)])
features_tab <- rbind(features_tab, distinct(all_neg_data[,list(IDUniq, MSI, `Alignment ID`, `Average Rt(min)`, `Average Mz`, `Metabolite name`, INCHIKEY, `Adduct type`, Dataset, AvgMZ, AvgRt, NewID2)]))
features_tab[,IonMode:=gsub(".*_", "", IDUniq)]

### Reset these tables 
met_data_means <- fread("processedDatasets/mouse_intestinal_mean_summaries.csv")
serum_data_means <- fread("processedDatasets/mouse_serum_mean_summaries.csv")

features_tab[,InGL:=ifelse(NewID2 %in% features_tab[Dataset == "GL", NewID2] & !is.na(NewID2), 1, 0)]
features_tab[,InPilot:=ifelse(NewID2 %in% features_tab[Dataset == "Pilot", NewID2] & !is.na(NewID2), 1, 0)]
features_tab[,InTimeCourse:=ifelse(NewID2 %in% features_tab[Dataset == "TimeCourse", NewID2] & !is.na(NewID2), 1, 0)]
features_tab[,InVitro:=ifelse(InGL==1|InTimeCourse==1, "Also detected in defined\nmedia experiments", "Not detected")]
intest_features_tab <- features_tab[grepl("Intestinal Contents", IDUniq) & IDUniq %in% good_intest_features]

## Add merged IDs to mouse dataset
met_data_means[,IDUniq2:=paste0("Intestinal Contents_", AlignmentID, "_", ifelse(grepl("ositive", IDUniq), "Pos", "Neg"))]
met_data_means <- merge(met_data_means, intest_features_tab[!is.na(NewID2), list(IDUniq, NewID2)], by.x = "IDUniq2", by.y = "IDUniq", all.x = T)

met_data_means <- met_data_means[IDUniq2 %in% good_intest_features]

count_plot_serum <- ggplot(features_tab[(grepl("Serum", IDUniq)|grepl("Intest", IDUniq)) & IDUniq %in% c(good_intest_features, good_serum_features)], 
                           aes(x = IonMode, fill = factor(InVitro))) + geom_bar(color = "black") + 
  scale_fill_brewer(palette = "Paired", name  ="") + ylab("Number of features") + coord_flip() + 
  facet_wrap(~Dataset, scales = "free_x") + theme(strip.background = element_blank())

ggsave(count_plot_serum, file = paste0(outdir, "intestinal_serum_features_count.pdf"), width = 5, height = 1.8)

count_plot_serum

## Combine mouse data with strain and time series in vitro data
time_series_results <- fread("processedDatasets/timecourse_mean_summaries.csv")
time_series_results[,IDUniq2:=paste0("TimeCourse_", AlignmentID, "_", ifelse(grepl("Pos", IDUniq), "Pos", "Neg"))]
time_series_results <- merge(time_series_results, features_tab[,list(IDUniq, NewID2)], by.x = "IDUniq2", by.y = "IDUniq", all.x = T)


strain_results <- fread("processedDatasets/strains_edm_mean_summaries.csv")
strain_results[,IDUniq2:=paste0("GL_", AlignmentID, "_", ifelse(grepl("Pos", IDUniq), "Pos", "Neg"))]
strain_results <- merge(strain_results, features_tab[,list(IDUniq, NewID2)], by.x = "IDUniq2", by.y = "IDUniq", all.x = T)

time_series_results[,Strain:=case_when(
  Strain == "2243" ~ "Eggerthella_lenta_UCSF2243",
  Strain == "Val" ~ "Eggerthella_lenta_Valencia",
  Strain == "AB8" ~ "Eggerthella_lenta_AB8n2", 
  TRUE ~ "Ctrl")]
time_series_all_sub <- time_series_results[!is.na(NewID2) & TimePoint==6, 
                                           list(log2FC_adj[which.min(FDRCorrect)], 
                                                estimate[which.min(FDRCorrect)], 
                                                p.value[which.min(FDRCorrect)], 
                                                meanValue[which.min(FDRCorrect)], 
                                                sdValue[which.min(FDRCorrect)], 
                                                FDRCorrect[which.min(FDRCorrect)]), by = list(NewID2, AcConc, Strain)]
setnames(time_series_all_sub, paste0("V", 1:6), paste0("TimeSeries_", c("log2FC", "ctrlDiff", "p.value", "meanValue", "sdValue", "FDRCorrect")))

met_data_means[,Strain:=case_when(
  Group == "2243" ~ "Eggerthella_lenta_UCSF2243",
  Group == "15644" ~ "Eggerthella_lenta_DSM15644",
  Group == "AB12n2" ~ "Eggerthella_lenta_AB12n2"
)]

met_data_means <- merge(met_data_means, time_series_all_sub[AcConc==1], by = c("NewID2", "Strain"), all.x = T)

strain_results_sub <- strain_results[!is.na(NewID2) & Name2 %in% met_data_means[,Strain],
                                     list(log2FC[which.min(FDRCorrect)], estimate[which.min(FDRCorrect)], 
                                          p.value[which.min(FDRCorrect)], meanValue[which.min(FDRCorrect)], 
                                          sdValue[which.min(FDRCorrect)], FDRCorrect[which.min(FDRCorrect)]), 
                                     by = list(NewID2, Name2)]
setnames(strain_results_sub, paste0("V", 1:6), paste0("Strains_", c("log2FC", "estimate", "p.value", "meanValue", "sdValue", "FDRCorrect")))
met_data_means <- merge(met_data_means, strain_results_sub, by.x = c("NewID2", "Strain"), by.y = c("NewID2", "Name2"), all.x = T)

met_data_means[,EstimateLog2Scale:=log2(10^Estimate)]
met_data_means[,Site:=factor(Site, levels = c("Ileum", "Cecum", "Colon"))]

met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & !is.na(Site)& IDUniq2 %in% good_intest_features,
               SharedShiftTimeSeries:=ifelse((TimeSeries_log2FC > 1 & EstimateLog2Scale > 1 & FDRCorrect < 0.2)|
                    (TimeSeries_log2FC < -1 & EstimateLog2Scale < -1 & FDRCorrect < 0.2), "Shared shift", "Not")]

plot2243 <- ggplot(met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & !is.na(Site)& IDUniq2 %in% good_intest_features & SharedShiftTimeSeries == "Not"], 
                   aes(x = TimeSeries_log2FC, y = EstimateLog2Scale, fill = SharedShiftTimeSeries)) + 
  geom_vline(xintercept=0) + geom_hline(yintercept = 0) + geom_vline(xintercept = 1, linetype = 2, color = "gray30") + 
  geom_vline(xintercept = -1, linetype = 2, color = "gray30")  + 
  geom_hline(yintercept = 1, linetype = 2, color = "gray30") + 
  geom_hline(yintercept = -1, linetype = 2, color = "gray30") + 
  geom_point(alpha = 0.7, shape = 21) + facet_grid(.~Site) + 
  geom_point(alpha = 0.7, shape = 21, data = met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & !is.na(Site)& IDUniq2 %in% good_intest_features & SharedShiftTimeSeries == "Shared shift"]) +
  scale_fill_manual(values = c("gray30", brewer.pal(3, "Dark2")[1]), name = "") + 
  ylab("Estimated intestinal log2 fold change") + xlab("log2 fold change in vitro in EDM time course experiment") + 
  theme(strip.background = element_blank())

## Stats/counts

met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & !is.na(Site) & FDRCorrect < 0.2, table(
  (EstimateLog2Scale > 0 & (Strains_log2FC > 0|TimeSeries_log2FC > 0))|(EstimateLog2Scale < 0 & (Strains_log2FC < 0|TimeSeries_log2FC < 0))
)]
## 
## FALSE  TRUE 
##   113   469
met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & !is.na(Site) & FDRCorrect < 0.2 & EstimateLog2Scale > 0, table(
  ((Strains_log2FC > 0|TimeSeries_log2FC > 0))
)]
## 
## FALSE  TRUE 
##   106   443
met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & Site == "Cecum" & FDRCorrect < 0.2 & EstimateLog2Scale > 0, table(
  ((Strains_log2FC > 0|TimeSeries_log2FC > 0))
)]
## 
## FALSE  TRUE 
##    54   202
met_data_means[Strain == "Eggerthella_lenta_UCSF2243"  & Site == "Cecum", length(unique(IDUniq[EstimateLog2Scale > 0 & FDRCorrect < 0.2]))]
## [1] 967
met_data_means[Strain == "Eggerthella_lenta_UCSF2243"  & !is.na(Site), length(unique(IDUniq[EstimateLog2Scale > 0 & FDRCorrect < 0.2]))]
## [1] 1596
met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & !is.na(Site) & FDRCorrect < 0.2 & EstimateLog2Scale < 0, table(
  ((Strains_log2FC < 0|TimeSeries_log2FC < 0))
)]
## 
## FALSE  TRUE 
##     7    26
met_data_means[Strain == "Eggerthella_lenta_UCSF2243" & Site == "Cecum" & FDRCorrect < 0.2 & EstimateLog2Scale < 0, table(
  ((Strains_log2FC < 0|TimeSeries_log2FC < 0))
)]
## 
## FALSE  TRUE 
##     3    18
met_data_means[Strain == "Eggerthella_lenta_UCSF2243"  & Site == "Cecum", length(unique(IDUniq[EstimateLog2Scale < 0 & 
                                                                                                 FDRCorrect < 0.2]))]
## [1] 405
met_data_means[Strain == "Eggerthella_lenta_UCSF2243"  & !is.na(Site), length(unique(IDUniq[EstimateLog2Scale < 0 & FDRCorrect < 0.1]))]
## [1] 294
met_data_means[,Strain:=factor(Strain, levels = c("Eggerthella_lenta_UCSF2243", "Eggerthella_lenta_DSM15644", "Eggerthella_lenta_AB12n2"))]

strain_tests <- met_data_means %>% filter(!is.na(Estimate) & !is.na(Strains_log2FC)) %>% group_by(Site, Strain) %>% summarize(tidy(cor.test(Strains_log2FC , Estimate, method = "spearman")))
## `summarise()` has grouped output by 'Site'. You can override using the `.groups`
## argument.
strain_tests2 <- met_data_means %>% filter(!is.na(Estimate) & !is.na(Strains_log2FC) & IDUniq2 %in% good_intest_features) %>% group_by(Site, Strain) %>% 
  summarize(NumSharedMetsProd = sum(EstimateLog2Scale > 1 & Strains_log2FC > 1 & FDRCorrect < 0.2), 
            FracSharedMetsProd = sum(EstimateLog2Scale > 1 & Strains_log2FC > 1 & FDRCorrect < 0.2)/sum(EstimateLog2Scale > 1 & FDRCorrect < 0.2),
            NumSharedMetsUse = sum(EstimateLog2Scale < -1 & Strains_log2FC < -1 & FDRCorrect < 0.2), 
            FracSharedMetsUse = sum(EstimateLog2Scale < -1 & Strains_log2FC < -1 & FDRCorrect < 0.2)/sum(EstimateLog2Scale < -1 & FDRCorrect < 0.2)
  )
## `summarise()` has grouped output by 'Site'. You can override using the `.groups`
## argument.
## Site came from the modeling results so it is NA for all the features w/out modeling results

met_data_means[!is.na(Strain) & !is.na(Site)& IDUniq2 %in% good_intest_features,SharedShiftStrain:=ifelse((Strains_log2FC > 1 & EstimateLog2Scale > 1 & FDRCorrect < 0.2)|
                                                                                                            (Strains_log2FC < -1 & EstimateLog2Scale < -1 & FDRCorrect < 0.2), 
                                                                                                          "Shared shift", "Not")]              

strain_effect_comparison_plot <- ggplot(met_data_means[!is.na(Strain) & !is.na(Site) & Site != "" & !is.na(FDRCorrect) & IDUniq2 %in% good_intest_features & SharedShiftStrain == "Not"], 
                                        aes(x = Strains_log2FC, y = EstimateLog2Scale)) + theme(panel.border = element_rect(color = "black", fill = NA))+ 
  geom_vline(xintercept = 1, linetype = 2, color = "gray30") + geom_vline(xintercept = -1, linetype = 2, color = "gray30")  + 
  geom_hline(yintercept = 1, linetype = 2, color = "gray30") + geom_hline(yintercept = -1, linetype = 2, color = "gray30") +
  geom_vline(xintercept=0) + geom_hline(yintercept = 0) + geom_point(shape = 21, size = 1, alpha = 0.8, aes(fill = SharedShiftStrain)) + 
  facet_grid(Strain~Site)+ geom_point(shape = 21, size = 1, alpha = 0.8, aes(fill = SharedShiftStrain), data = met_data_means[!is.na(Strain) & !is.na(Site) & Site != "" & !is.na(FDRCorrect) & IDUniq2 %in% good_intest_features & SharedShiftStrain == "Shared shift"]) +
  geom_text(data = strain_tests2, aes(label = paste0("N shared \nProduced = ", NumSharedMetsProd,"\nDepleted = ", NumSharedMetsUse)), x = -9, y = 7.5, size = 2.5) + 
  ylab("Estimated intestinal log2 fold change") + xlab("log2 fold change in EDM1 strains experiment") + scale_fill_manual(values = c("gray30", brewer.pal(3, "Dark2")[1]), name = "") 


## Same for serum metabolites

serum_data_means[,Strain:=case_when(
  Group == "El2243" ~ "Eggerthella_lenta_UCSF2243",
  Group == "El15644" ~ "Eggerthella_lenta_DSM15644",
  Group == "ElAB12n2" ~ "Eggerthella_lenta_AB12n2"
)]
serum_data_means[,IDUniq2:=paste0("Serum_", AlignmentID, "_", ifelse(grepl("Pos", IDUniq, ignore.case = T), "Pos", "Neg"))]
serum_data_means <- serum_data_means[IDUniq2 %in% good_serum_features]
serum_data_means <- merge(serum_data_means, features_tab[!is.na(NewID2), list(IDUniq, NewID2)], by.x = "IDUniq2", by.y = "IDUniq", all.x = T)
serum_data_means <- merge(serum_data_means, strain_results_sub, by.x = c("NewID2", "Strain"), by.y = c("NewID2", "Name2"), all.x = T)
serum_data_means <- merge(serum_data_means, time_series_all_sub[AcConc==1], by = c("NewID2", "Strain"), all.x = T)
serum_data_means[,EstimateLog2Scale:=log2(10^estimate)]

serum_data_means[,Strain:=factor(Strain, levels = c("Eggerthella_lenta_UCSF2243", "Eggerthella_lenta_DSM15644", "Eggerthella_lenta_AB12n2"))]


strain_tests_serum2 <- serum_data_means %>% filter(!is.na(EstimateLog2Scale) & !is.na(Strains_log2FC)) %>% group_by(Strain) %>% 
  summarize(NumSharedMetsProd = sum(EstimateLog2Scale > 1 & Strains_log2FC > 1  & FDRCorrect < 0.2), 
            FracSharedMetsProd = sum(EstimateLog2Scale > 1 & Strains_log2FC > 1& FDRCorrect < 0.2)/sum(EstimateLog2Scale > 1 & FDRCorrect < 0.2),
            NumSharedMetsUse = sum(EstimateLog2Scale < -1 & Strains_log2FC < -1  & FDRCorrect < 0.2), 
            FracSharedMetsUse = sum(EstimateLog2Scale < -1 & Strains_log2FC < -1  & FDRCorrect < 0.2)/sum(EstimateLog2Scale < -1 & FDRCorrect < 0.2)
  )


serum_data_means[,Site:="Serum"]

serum_data_means[Strain == "Eggerthella_lenta_UCSF2243",
               SharedShiftTimeSeries:=ifelse((TimeSeries_log2FC > 1 & EstimateLog2Scale > 1 & FDRCorrect < 0.2)|
                                               (TimeSeries_log2FC < -1 & EstimateLog2Scale < -1 & FDRCorrect < 0.2), "Shared shift", "Not")]

## Time series dataset
serum_plot_timeseries <- ggplot(serum_data_means[Strain == "Eggerthella_lenta_UCSF2243" & SharedShiftTimeSeries == "Not"], 
                   aes(x = TimeSeries_log2FC, y = EstimateLog2Scale, fill = SharedShiftTimeSeries)) + 
  geom_vline(xintercept=0) + geom_hline(yintercept = 0) + geom_vline(xintercept = 1, linetype = 2, color = "gray30") + 
  geom_vline(xintercept = -1, linetype = 2, color = "gray30")  + 
  geom_hline(yintercept = 1, linetype = 2, color = "gray30") + 
  geom_hline(yintercept = -1, linetype = 2, color = "gray30") + 
  geom_point(alpha = 0.7, shape = 21) + facet_grid(.~Site) + 
  geom_point(alpha = 0.7, shape = 21, data = serum_data_means[Strain == "Eggerthella_lenta_UCSF2243" & SharedShiftTimeSeries == "Shared shift"]) +
  scale_fill_manual(values = c("gray30", brewer.pal(3, "Dark2")[1]), name = "") + 
  ylab("Estimated log2 fold change in serum") + xlab("log2 fold change in vitro in EDM time course experiment") + 
  theme(strip.background = element_blank())
ggsave(serum_plot_timeseries, file = paste0(outdir, "TimeSeries_SerumComparison.pdf"), width = 3.4, height = 2.7)

time_series_comparison_all <- plot2243  + serum_plot_timeseries + guides(fill = "none")+ plot_layout(widths = c(3.1,1), guides = "collect")
ggsave(time_series_comparison_all, file = paste0(outdir, "combined_TimeSeriesCompare_simplifiedColors.pdf"), height = 2.7, width = 10)

time_series_comparison_all

serum_data_means[,SharedShift:=ifelse((Strains_log2FC > 1 & EstimateLog2Scale > 1 & FDRCorrect < 0.2)|(Strains_log2FC < -1 & EstimateLog2Scale < -1& FDRCorrect < 0.2), "Shared shift", "Not")]

serum_plot <- ggplot(serum_data_means[!is.na(Strain) & !is.na(Strains_log2FC) & SharedShift == "Not"], aes(x = Strains_log2FC, y = EstimateLog2Scale)) + 
  geom_vline(xintercept = 1, linetype = 2, color = "gray30") + geom_vline(xintercept = -1, linetype = 2, color = "gray30")+ 
  geom_hline(yintercept = 1, linetype = 2, color = "gray30") + geom_hline(yintercept = -1, linetype = 2, color = "gray30") +
  geom_vline(xintercept=0) + geom_hline(yintercept = 0) + 
  geom_point(size = 1, shape = 21, alpha = 0.8, aes(fill = SharedShift)) + 
  geom_point(size = 1, shape = 21, alpha = 0.8, aes(fill = SharedShift), data = serum_data_means[!is.na(Strain) & !is.na(Strains_log2FC) & SharedShift == "Shared shift"]) + facet_grid(Strain~Site) + 
  geom_text(data = strain_tests_serum2, aes(label = paste0("N shared \nProduced = ", NumSharedMetsProd,"\nDepleted = ", NumSharedMetsUse)), x = -7.5, y = 2, size = 2.5) + 
  ylab("Estimated log2 fold change in serum") + xlab("log2 fold change in EDM strains experiment") + 
  scale_fill_manual(values = c("gray30", brewer.pal(3, "Dark2")[1]), name = "") + theme(panel.border = element_rect(color = "black", fill = NA)) 

strain_effect_comparison_all <- strain_effect_comparison_plot  + serum_plot + guides(fill = "none")+ plot_layout(widths = c(3.1,1))

ggsave(strain_effect_comparison_all, file = paste0(outdir, "combined_strainCompare_simplifiedColors.pdf"), height = 6.2, width = 10)

strain_effect_comparison_all

3 Top shifted compounds

met_data_means[,RankAbsEstimate:=length(Estimate)-rank(abs(Estimate)), by = list(Site, Strain)]
met_data_means[,RankAbsEstimateAllSites:=length(Estimate)-rank(abs(Estimate)), by = Strain]
met_data_means[,MetName2:=paste0(MetName, AlignmentID, IonMode)]

rank_compound_tab <- met_data_means[,max(abs(Estimate))*ifelse(Estimate[which.max(abs(Estimate))] < 0, -1, 1), by=list(MetName2, Strain)]
rank_compound_tab[,CompRank:=length(V1)-rank(abs(V1)), by = Strain]
rank_compound_tab[,CompRankProdUse:=length(V1)-rank(abs(V1)), by= list(Strain, V1 < 0)]
rank_compound_tab[!grepl("Unknown", MetName2), CompRankProdUseID:=length(V1)-rank(abs(V1)), by = list(Strain, V1 < 0)]

met_order <- met_data_means[grepl("2243", Strain), max(abs(Estimate))*ifelse(Estimate[which.max(abs(Estimate))] < 0, -1, 1), by=MetName2][order(V1, decreasing = T), MetName2]

gnps_color_scale <- brewer.pal(10, "Set3")[c(1:9)]
names(gnps_color_scale) <- c(met_data_means[CF_superclass != "no matches", sort(unique(CF_superclass))], "no matches")

indiv_comp_plot <- ggplot(met_data_means[MetName2 %in% rank_compound_tab[CompRankProdUse < 600 & grepl("2243", Strain), MetName2] & grepl("2243", Strain) & 
                                           !is.na(Strain) & !is.na(Site) & MetName != "Unknown" ], aes(x = factor(MetName2, levels = rev(met_order)), 
                                                                                                       y = EstimateLog2Scale)) + geom_errorbar(width = 0, aes(ymin = EstimateLog2Scale - log2(10^(`Std. Error`)), ymax = EstimateLog2Scale + log2(10^(`Std. Error`)))) + 
  geom_point(aes(fill = CF_superclass, shape = Site), size = 2.4) + coord_flip() + geom_hline(yintercept = 0, linetype = 2) + scale_x_discrete(labels = function(e){ gsub("[0-9]+[A-Z][a-z]+$", "", e)}, name = "") + ylab("log2 fold change for UCSF2243 vs GF") + scale_fill_manual(values = gnps_color_scale, name = "", guide = guide_legend(override.aes = list(shape = 21)), drop = T) + scale_shape_manual(values = 21:23)

ggsave(indiv_comp_plot, file = paste0(outdir, "top_identified_mets2243_updated.pdf"), width = 6.3, height = 4.7)

indiv_comp_plot

top_prods <- rank_compound_tab[CompRankProdUseID < 9 & grepl("2243", Strain)]
top_used <- rank_compound_tab[CompRankProdUseID < 9 & grepl("2243", Strain) & V1 < 0]

### Simplified version (poster)
indiv_comp_plot_simple <- ggplot(met_data_means[MetName2 %in% top_used[,MetName2] & grepl("2243", Strain) & 
                                                  !is.na(Strain) & !is.na(Site) & MetName != "Unknown" ], 
                                 aes(x = factor(MetName2, levels = rev(met_order)), y = EstimateLog2Scale)) + 
  geom_errorbar(width = 0, aes(ymin = EstimateLog2Scale - log2(10^(`Std. Error`)), ymax = EstimateLog2Scale + 
                                 log2(10^(`Std. Error`)))) + geom_point(aes(fill = MetName2, shape = Site), size = 3) + 
  coord_flip() + geom_hline(yintercept = 0, linetype = 2) + scale_x_discrete(labels = function(e){ gsub("[0-9]+[A-Z][a-z]+$", "", e)}, name = "") + 
  ylab("log2 fold change\nE. lenta DSM2243 vs GF")  + scale_shape_manual(values = 21:23) + scale_fill_brewer(palette = "Set3") + guides(fill = "none") 

ggsave(indiv_comp_plot_simple, file = paste0(outdir, "top_identified_mets2243_poster.pdf"), width = 5, height = 3.3)

indiv_comp_plot_simple

indiv_comp_plot_strains <- ggplot(met_data_means[MetName2 %in% rank_compound_tab[CompRankProdUse < 388, MetName2] & 
                                                   !is.na(Strain) & !is.na(Site) & MetName != "Unknown" ], 
                                  aes(x = factor(MetName2, levels = rev(met_order)), y = EstimateLog2Scale)) + 
  geom_errorbar(width = 0, aes(ymin = EstimateLog2Scale - log2(10^(`Std. Error`)), 
                               ymax = EstimateLog2Scale + log2(10^(`Std. Error`)))) + 
  geom_point(aes(fill = CF_superclass, shape = Site), size = 2.4) + coord_flip() + 
  geom_hline(yintercept = 0, linetype = 2) + scale_x_discrete(labels = function(e){ gsub("[0-9]+[A-Z][a-z]+$", "", e)},
                                                              name = "") +
  ylab("log2 fold change vs GF") + scale_fill_manual(values = gnps_color_scale, name = "", 
                                                     guide = guide_legend(override.aes = list(shape = 21))) + 
  scale_shape_manual(values = 21:23) + facet_grid(.~Strain) + theme(axis.text = element_text(size = 8))

ggsave(indiv_comp_plot_strains, file = paste0(outdir, "top_identified_mets_allStrains.pdf"), width = 11, height = 5)

indiv_comp_plot_strains

3.1 Figure 6 - agmatine RNA-seq and genomics

rm(list = ls())
##### Figure 6 - RNA-seq
library(data.table)
library(tidyverse)
library(DESeq2)
## Loading required package: S4Vectors
## Loading required package: stats4
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:dplyr':
## 
##     combine, intersect, setdiff, union
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, basename, cbind, colnames,
##     dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
##     grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
##     order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
##     rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
##     union, unique, unsplit, which.max, which.min
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## The following object is masked from 'package:tidyr':
## 
##     expand
## The following objects are masked from 'package:data.table':
## 
##     first, second
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## Loading required package: IRanges
## 
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
## 
##     collapse, desc, slice
## The following object is masked from 'package:purrr':
## 
##     reduce
## The following object is masked from 'package:data.table':
## 
##     shift
## Loading required package: GenomicRanges
## Loading required package: GenomeInfoDb
## Loading required package: SummarizedExperiment
## Loading required package: MatrixGenerics
## Loading required package: matrixStats
## 
## Attaching package: 'matrixStats'
## The following object is masked from 'package:dplyr':
## 
##     count
## 
## Attaching package: 'MatrixGenerics'
## The following objects are masked from 'package:matrixStats':
## 
##     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
##     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
##     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
##     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
##     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
##     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
##     colWeightedMeans, colWeightedMedians, colWeightedSds,
##     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
##     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
##     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
##     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
##     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
##     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
##     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
##     rowWeightedSds, rowWeightedVars
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## 
## Attaching package: 'Biobase'
## The following object is masked from 'package:MatrixGenerics':
## 
##     rowMedians
## The following objects are masked from 'package:matrixStats':
## 
##     anyMissing, rowMedians
library(ggrepel)
library(ggpubr)
library(vsn)
theme_set(theme_classic2())

datadir <- "../RNASeq_2022-02/"
outdir <- "figure6/"
dir.create(outdir)

sessionInfo()
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.4 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] vsn_3.60.0                  DESeq2_1.32.0              
##  [3] SummarizedExperiment_1.22.0 Biobase_2.54.0             
##  [5] MatrixGenerics_1.4.3        matrixStats_0.62.0         
##  [7] GenomicRanges_1.44.0        GenomeInfoDb_1.30.1        
##  [9] IRanges_2.28.0              S4Vectors_0.32.4           
## [11] BiocGenerics_0.40.0         broom_0.8.0                
## [13] patchwork_1.1.1             RColorBrewer_1.1-2         
## [15] ggpubr_0.4.0                forcats_0.5.1              
## [17] stringr_1.4.0               dplyr_1.0.7                
## [19] purrr_0.3.4                 readr_2.1.2                
## [21] tidyr_1.2.0                 tibble_3.1.7               
## [23] tidyverse_1.3.1             ggrepel_0.9.1              
## [25] ggplot2_3.3.6               data.table_1.14.2          
## 
## loaded via a namespace (and not attached):
##  [1] colorspace_2.0-3       ggsignif_0.6.3         ellipsis_0.3.2        
##  [4] XVector_0.34.0         fs_1.5.0               rstudioapi_0.13       
##  [7] farver_2.1.0           affyio_1.62.0          bit64_4.0.5           
## [10] AnnotationDbi_1.54.1   fansi_1.0.3            lubridate_1.8.0       
## [13] xml2_1.3.2             splines_4.1.1          cachem_1.0.6          
## [16] geneplotter_1.70.0     knitr_1.39             jsonlite_1.8.0        
## [19] annotate_1.70.0        dbplyr_2.1.1           png_0.1-7             
## [22] BiocManager_1.30.18    compiler_4.1.1         httr_1.4.2            
## [25] backports_1.2.1        assertthat_0.2.1       Matrix_1.4-1          
## [28] fastmap_1.1.0          limma_3.48.3           cli_3.3.0             
## [31] htmltools_0.5.2        tools_4.1.1            affy_1.70.0           
## [34] gtable_0.3.0           glue_1.6.2             GenomeInfoDbData_1.2.7
## [37] Rcpp_1.0.8.3           carData_3.0-5          cellranger_1.1.0      
## [40] jquerylib_0.1.4        vctrs_0.4.1            Biostrings_2.62.0     
## [43] preprocessCore_1.54.0  xfun_0.31              rvest_1.0.2           
## [46] lifecycle_1.0.0        rstatix_0.7.0          XML_3.99-0.9          
## [49] zlibbioc_1.40.0        scales_1.1.1           hms_1.1.1             
## [52] parallel_4.1.1         yaml_2.3.5             memoise_2.0.0         
## [55] sass_0.4.1             stringi_1.7.6          RSQLite_2.2.14        
## [58] highr_0.9              genefilter_1.74.1      BiocParallel_1.26.2   
## [61] rlang_1.0.2            pkgconfig_2.0.3        bitops_1.0-7          
## [64] evaluate_0.15          lattice_0.20-45        labeling_0.4.2        
## [67] bit_4.0.4              tidyselect_1.1.2       magrittr_2.0.3        
## [70] R6_2.5.1               generics_0.1.0         DelayedArray_0.18.0   
## [73] DBI_1.1.1              pillar_1.7.0           haven_2.5.0           
## [76] withr_2.5.0            survival_3.3-1         KEGGREST_1.32.0       
## [79] abind_1.4-5            RCurl_1.98-1.7         modelr_0.1.8          
## [82] crayon_1.4.1           car_3.0-13             utf8_1.2.2            
## [85] tzdb_0.3.0             rmarkdown_2.14         locfit_1.5-9.5        
## [88] grid_4.1.1             readxl_1.3.1           blob_1.2.3            
## [91] reprex_2.0.1           digest_0.6.29          xtable_1.8-4          
## [94] munsell_0.5.0          bslib_0.3.1
## To be able to look at old locus tags
annot_mapping_table <- fread("../../ElentaGenomeTables/mappingTable_NCBI_2243REF_oldLocusTags.tsv")
locus_map <- unique(annot_mapping_table[,list(locus_tag, old_locus_tag)])

## Set up gff file
gff <- fread(paste0(datadir, "GCF_000024265.1_ASM2426v1_genomic.gff"))
setnames(gff, c("Chromosome", "Annotation", "Type", "Start", "End", "Score", "Strand", "Phase", "Attr"))
gff <- gff[Type %in% c("CDS","riboswitch", "RNase_P_RNA", "rRNA", "SRP_RNA", "tmRNA", "tRNA")]
gff[,Attr:=strsplit(Attr, split = ";")]
gff[,ID:=sapply(Attr, function(x){
  return(gsub("ID=", "", x[grepl("ID", x)]))
})]
gff[,gene_biotype:=sapply(Attr, function(x){
  if(any(grepl("gene_biotype", x))){
    return(gsub("gene_biotype=", "", x[grepl("gene_biotype", x)]))
  } else return(NA)
})]
gff[,locus_tag:=as.character(sapply(Attr, function(x){
  if(any(grepl("locus_tag", x))){
    return(gsub("locus_tag=", "", x[grepl("locus_tag", x)]))
  } else return(NA)
}))]
gff[,gene:=sapply(Attr, function(x){
  if(any(grepl("gene", x))){
    return(gsub("gene=", "", x[grepl("gene=", x)]))
  } else return(NA)
})]
gff[,product:=sapply(Attr, function(x){
  if(any(grepl("product", x))){
    return(gsub("product=", "", x[grepl("product", x)]))
  } else return(NA)
})]
gff[,Parent:=sapply(Attr, function(x){
  return(gsub("Parent=", "", x[grepl("Parent", x)]))
})]
gff[,Parent:=as.character(Parent)]
gff[sapply(gene, length)==0, gene:=NA]
gff[,Name2:=ifelse(is.na(gene), gsub("gene-", "", Parent), gene)]
gff[,Name2:=as.character(Name2)]

gff <- merge(gff, locus_map, by = "locus_tag", all.x = T)

#### Hisat + featurecounts output
load(paste0(datadir, "counts/FeatureCountsResultHisat2.rda"))

fwrite(as.data.frame(aligned3$counts), file = paste0(outdir, "rnaSeq_countData.txt"), sep = "\t", row.names = T)

count_table3 <- aligned3$counts %>% as.data.frame() %>% 
  rownames_to_column("Gene") %>% as.data.table() %>% 
  melt(id.var = "Gene", variable.name = "Sample")
count_table3[order(value, decreasing = T)]
##                      Gene     Sample  value
##     1:   rna-ELEN_RS15935 A1_S49.bam 912247
##     2:   rna-ELEN_RS15935 G2_S47.bam 757548
##     3:   rna-ELEN_RS15935 R2_S44.bam 700429
##     4:   rna-ELEN_RS15935 A2_S50.bam 648512
##     5:   rna-ELEN_RS15935 G1_S46.bam 648108
##    ---                                     
## 37904: cds-WP_015761389.1 V3_S54.bam      0
## 37905: cds-WP_009306879.1 V3_S54.bam      0
## 37906: cds-WP_009609032.1 V3_S54.bam      0
## 37907: cds-WP_057385068.1 V3_S54.bam      0
## 37908: cds-WP_009305380.1 V3_S54.bam      0
gff[,GeneLen:=End-Start]
count_table3 <- merge(count_table3, gff[,list(ID, gene, locus_tag, product, Parent, Type, Name2, old_locus_tag, GeneLen)], by.x = "Gene", by.y = "ID", all.x = T)
count_table3[,FeatureCounts_RPK:=value/GeneLen*1000]
count_table3[,FeatureCounts_TPM:=FeatureCounts_RPK*1e6/sum(FeatureCounts_RPK, na.rm = T), by=Sample]

mean_baseline_count3 <- count_table3[grepl("V", Sample), mean(FeatureCounts_TPM), by=list(locus_tag, Name2, old_locus_tag)]
mean_baseline_count3 <- merge(mean_baseline_count3, gff[,list(locus_tag, Name2, product)], by=c("locus_tag", "Name2"), all.x = T)

## What are the most highly expressed genes?
count_mat3 <- dcast(count_table3[!grepl("rna-", Gene) & !is.na(locus_tag)], locus_tag~Sample, value.var = "value") %>% column_to_rownames("locus_tag") %>% as.matrix()

count_table3[,Group:=gsub("[0-9]_.*.bam", "", Sample)]
samp_table <- unique(count_table3[,list(Sample, Group)])

### Run DESeq on all samples
deseq_dat3 <-
  DESeqDataSetFromMatrix(
    countData=count_mat3,
    colData=column_to_rownames(samp_table, "Sample"),
    design=~Group
  )

## Check out PCA plot
vst3 <- vst(deseq_dat3, blind = TRUE)
vst_mat3 <- assay(vst3)
#Only on highest-variance genes
rv <- rowVars(vst_mat3)
hist(rv, breaks = 100) #500 looks pretty good

select <- order(rv, decreasing = TRUE)[seq_len(500)]

pca3 <- prcomp(t(vst_mat3[select,]))
pca_dat3 <- data.table(rownames_to_column(data.frame(pca3$x), "Sample"))
loadings3 <- data.table(rownames_to_column(data.frame(pca3$rotation), "Gene"))
loadings3[,PC1_PC2_len:=sqrt(PC1^2+PC2^2)]
loadings3 <- merge(loadings3, gff[,list(ID, gene, product, Parent, Type, Name2, locus_tag)], by.x = "Gene", by.y = "locus_tag", all.x = T)

vst_tab3 <- data.table(vst_mat3 %>% as.data.frame() %>% rownames_to_column("Gene")) %>% melt(id.var = "Gene", variable.name = "Sample")
vst_tab3[,Group:=gsub("[0-9]_.*", "", Sample)]
vst_tab3 <- merge(vst_tab3, gff[,list(ID, gene, product, Parent, Type, Name2, locus_tag)], by.x = "Gene", by.y = "locus_tag", all.x = T)
vst_tab3[,Name2:=as.character(Name2)]
vst_tab3[,product:=as.character(product)]
vst_tab3[,Parent:=as.character(Parent)]

pca_dat3[,Group:=gsub("[0-9]_.*", "", Sample)]
pca_dat3[,Group:=factor(Group, levels = c("V", "R", "A", "G"))]
levels(pca_dat3$Group) <- c("Vehicle (H2O)", "Arginine", "Acetate", "Agmatine")
biplot3 <- ggplot(pca_dat3, aes(x = PC1, y = PC2, color = Group))+ geom_segment(data = loadings3[PC1_PC2_len > 0.15], aes(x=PC1*30, y = PC2*30), xend = 0, yend = 0, inherit.aes = F, alpha = 0.5, color = "gray50") + geom_text_repel(data = loadings3[PC1_PC2_len > 0.15], aes(x = PC1*30, y = PC2*30, label = Name2), alpha = 0.7, inherit.aes = F, size = 2.5)  + geom_point(size = 2) + theme_classic2() + scale_color_brewer(palette = "Set2", name = "Group") + xlab(paste0("PC1 (", round(summary(pca3)$importance[2,1], digits = 3)*100, "%)"))+ ylab(paste0("PC2 (", round(summary(pca3)$importance[2,2], digits = 3)*100, "%)"))

ggsave(biplot3, file = paste0(outdir, "pca_biplot3_hisat_top500.pdf"), width = 5, height = 3.5)

biplot3

### Differential abundance tables
dds3 <- DESeq(deseq_dat3)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
results_ac3 <- results(dds3, contrast = c("Group", "A", "V")) %>% as.data.table()
setnames(results_ac3, paste0(names(results_ac3), "_Ac"))
results_ac3[,Gene:=rownames(dds3)]
results_agm3 <- results(dds3, contrast = c("Group", "G", "V")) %>% as.data.table()
setnames(results_agm3, paste0(names(results_agm3), "_Agm"))
results_agm3[,Gene:=rownames(dds3)]
results_arg3 <- results(dds3, contrast = c("Group", "R", "V")) %>% as.data.table()
setnames(results_arg3, paste0(names(results_arg3), "_Arg"))
results_arg3[,Gene:=rownames(dds3)]
results_all3 <- merge(results_ac3, results_agm3, by = "Gene", all = T) %>% merge(results_arg3, by = "Gene", all = T)
results_all3 <- merge(results_all3, gff[,list(ID, Parent, Name2, product, old_locus_tag, locus_tag)], by.x = "Gene", by.y = "locus_tag", all.x = T)

results_all3[padj_Agm < 0.1 & log2FoldChange_Agm > 0][order(padj_Agm)]
##             Gene baseMean_Ac log2FoldChange_Ac  lfcSE_Ac     stat_Ac
##  1: ELEN_RS03400 16914.67340       -0.52886654 0.2281098 -2.31847334
##  2: ELEN_RS11010 12293.10163       -0.34442382 0.2542887 -1.35445962
##  3: ELEN_RS03390 29542.26098       -0.42757508 0.2680636 -1.59505090
##  4: ELEN_RS03395 13734.46709       -0.53235619 0.3356830 -1.58588975
##  5: ELEN_RS03380   199.76560       -0.31091379 0.3206559 -0.96961824
##  6: ELEN_RS06445  3219.13946       -0.46199467 0.3208597 -1.43986510
##  7: ELEN_RS06450   690.44979        0.07211051 0.2753999  0.26183933
##  8: ELEN_RS03410    85.90542        0.16537621 0.3967581  0.41681878
##  9: ELEN_RS06485   226.50931        0.03521562 0.2309232  0.15249929
## 10: ELEN_RS08500  1238.95286        0.05384940 0.1477649  0.36442625
## 11: ELEN_RS09695   580.58610        0.06706118 0.3533549  0.18978423
## 12: ELEN_RS10965   211.41217        0.22128340 0.6034121  0.36672018
## 13: ELEN_RS06405   233.66349        0.57171044 0.2140617  2.67077370
## 14: ELEN_RS04815   178.22700        0.05446353 0.2897702  0.18795420
## 15: ELEN_RS06480   167.93732        0.01815759 0.2622021  0.06925038
## 16: ELEN_RS00415   108.20576        0.66678368 0.3017423  2.20977889
## 17: ELEN_RS14490  1044.86776        0.25580705 0.1882724  1.35870687
## 18: ELEN_RS10980    44.82224        0.31367396 0.5373756  0.58371454
## 19: ELEN_RS16125    12.60491        1.31260013 0.7881591  1.66539994
## 20: ELEN_RS08985   141.43553        0.04901373 0.5552331  0.08827595
## 21: ELEN_RS08970    85.14754        0.57557141 0.6536982  0.88048492
## 22: ELEN_RS10970    46.57683        0.51118258 0.7215067  0.70849322
## 23: ELEN_RS09690   788.65322       -0.03096875 0.5156593 -0.06005661
## 24: ELEN_RS07075  1895.62576        0.27886149 0.1546132  1.80360770
## 25: ELEN_RS11380   662.10575        0.51301840 0.1783636  2.87625118
## 26: ELEN_RS13605  2521.19419        0.05850656 0.1286260  0.45485790
## 27: ELEN_RS09120   118.92478       -0.02403749 0.2209450 -0.10879396
## 28: ELEN_RS08840   435.15065        0.41301802 0.1864349  2.21534746
## 29: ELEN_RS08980   115.05123       -0.02726978 0.8512527 -0.03203488
## 30: ELEN_RS12535    90.04445        0.15745005 0.3106363  0.50686295
## 31: ELEN_RS05810  2894.50190        1.82751276 0.2336417  7.82185936
## 32: ELEN_RS14575   678.76669        0.09524832 0.2066768  0.46085639
## 33: ELEN_RS14370  1904.80208       -0.01864918 0.1207102 -0.15449545
## 34: ELEN_RS13710  1348.58134        0.46320302 0.2079353  2.22763094
## 35: ELEN_RS06440  3058.99570        0.04606724 0.1446836  0.31839994
## 36: ELEN_RS03025   434.67609        0.08296016 0.2283899  0.36323917
## 37: ELEN_RS02800  2915.60142        0.18757054 0.2196730  0.85386255
## 38: ELEN_RS08010   191.24700       -0.07564134 0.2358479 -0.32072085
## 39: ELEN_RS02230   153.41072        0.08076897 0.2220287  0.36377723
## 40: ELEN_RS15305   365.69505        0.34386189 0.2073228  1.65858211
## 41: ELEN_RS00080  1406.70664        0.30947647 0.1946466  1.58994002
## 42: ELEN_RS03375    40.71196       -0.03948518 0.3253078 -0.12137791
## 43: ELEN_RS00740  5401.14622        0.04062698 0.1047677  0.38778165
## 44: ELEN_RS13705   368.20221        0.33608995 0.1587399  2.11723714
## 45: ELEN_RS05635  1467.60567        0.35289300 0.1931581  1.82696421
## 46: ELEN_RS13960   222.72296       -0.12322714 0.1939943 -0.63521020
## 47: ELEN_RS08750    47.21230        0.48078052 0.3489767  1.37768655
## 48: ELEN_RS08825   284.94188        0.46353496 0.1980568  2.34041425
## 49: ELEN_RS02360   307.73628        2.17369126 1.1754797  1.84919502
## 50: ELEN_RS08870   142.29750        0.68549895 0.2570954  2.66632163
## 51: ELEN_RS11325   562.87698        0.20513293 0.1673958  1.22543646
## 52: ELEN_RS07090   586.11481        0.11454474 0.2437814  0.46986657
## 53: ELEN_RS09355  1957.42374       -0.13600713 0.2131336 -0.63813104
## 54: ELEN_RS15695    70.70710        2.02233734 0.7078860  2.85686862
## 55: ELEN_RS12650  1503.75650       -0.01507908 0.1404679 -0.10734892
## 56: ELEN_RS06465   329.44287        0.11575911 0.2308184  0.50151595
## 57: ELEN_RS14175   123.42130        0.18157157 0.2755371  0.65897327
## 58: ELEN_RS02795   229.35174        0.14269574 0.2542975  0.56113693
## 59: ELEN_RS05825  1947.26109        1.71265129 0.3359228  5.09834837
## 60: ELEN_RS10000  5202.86425        0.05837920 0.1576573  0.37029178
## 61: ELEN_RS01955  2773.65416        0.11306714 0.1892038  0.59759455
## 62: ELEN_RS09475   216.50234       -0.24399414 0.2083708 -1.17096122
## 63: ELEN_RS09345  1002.50477       -0.21141689 0.2396257 -0.88227955
## 64: ELEN_RS02805 17913.09774        0.19974425 0.2469745  0.80876478
## 65: ELEN_RS01995    20.65486        1.24521799 0.5779405  2.15457824
## 66: ELEN_RS11395   178.98499        0.14491466 0.2003137  0.72343871
## 67: ELEN_RS06210   321.55470        0.31341276 0.2373146  1.32066366
## 68: ELEN_RS01960  1662.77983        0.52432978 0.2477388  2.11646244
## 69: ELEN_RS01635    58.44438        1.44894920 0.7322667  1.97871778
## 70: ELEN_RS12485  1524.43731        0.25648920 0.2279424  1.12523692
## 71: ELEN_RS08880   118.20997        0.48037251 0.2799519  1.71591098
## 72: ELEN_RS00855   632.50302        3.21279210 1.2969231  2.47724188
## 73: ELEN_RS12410    47.04641        0.69692253 0.3639252  1.91501595
## 74: ELEN_RS03365    31.68185        0.19955121 0.4543096  0.43924057
## 75: ELEN_RS13795   247.02378        0.38341679 0.2962691  1.29415054
## 76: ELEN_RS15060  1077.49391        0.34335675 0.2668848  1.28653520
## 77: ELEN_RS10975    16.88948       -1.66181310 0.9530376 -1.74370144
## 78: ELEN_RS02210  1019.70234        0.47635418 0.2152541  2.21298527
## 79: ELEN_RS07660   231.85853        0.17195681 0.2384952  0.72100752
## 80: ELEN_RS04430    31.49301        2.68744647 0.8589886  3.12861731
## 81: ELEN_RS16350  1486.16130        0.92055904 0.3401279  2.70650856
## 82: ELEN_RS16360  8245.98592        0.68991335 0.3969953  1.73783744
## 83: ELEN_RS13940   267.27633        0.14586670 0.2617092  0.55736172
## 84: ELEN_RS14660   390.22242        0.47831914 0.2093867  2.28438166
## 85: ELEN_RS08975    12.59049        0.04060486 1.0820356  0.03752636
## 86: ELEN_RS15425  3512.64956        0.13048048 0.1441396  0.90523660
## 87: ELEN_RS03880   297.46680        0.47526742 0.2743489  1.73234644
## 88: ELEN_RS04215   133.54497        0.42221833 0.2487265  1.69752070
## 89: ELEN_RS05075   823.47924        1.76562133 1.1656575  1.51469987
## 90: ELEN_RS05790   483.11542        0.59680524 0.2413860  2.47241083
## 91: ELEN_RS10280 14031.73574        0.16775755 0.2454916  0.68335356
## 92: ELEN_RS09350   499.90212       -0.02114886 0.3410830 -0.06200504
## 93: ELEN_RS00780  1351.55482        0.14481729 0.1473902  0.98254360
## 94: ELEN_RS05310   149.34261       -0.07836332 0.2629007 -0.29807193
## 95: ELEN_RS10275  3742.23209        0.04314897 0.2162919  0.19949414
## 96: ELEN_RS13165 11842.73298        0.63819833 0.3651639  1.74770387
##             Gene baseMean_Ac log2FoldChange_Ac  lfcSE_Ac     stat_Ac
##        pvalue_Ac      padj_Ac baseMean_Agm log2FoldChange_Agm lfcSE_Agm
##  1: 2.042361e-02 5.996761e-01  16914.67340          6.6160381 0.2248712
##  2: 1.755898e-01 9.482795e-01  12293.10163          6.7512288 0.2504235
##  3: 1.107009e-01 9.189054e-01  29542.26098          6.8094204 0.2663889
##  4: 1.127643e-01 9.189054e-01  13734.46709          6.5164427 0.3331536
##  5: 3.322368e-01 9.689222e-01    199.76560          4.4184853 0.2800072
##  6: 1.499056e-01 9.482795e-01   3219.13946          4.2279422 0.3185234
##  7: 7.934453e-01 9.870812e-01    690.44979          2.7184494 0.2719477
##  8: 6.768110e-01 9.870812e-01     85.90542          3.2398330 0.3717585
##  9: 8.787931e-01 9.870812e-01    226.50931          1.7901967 0.2237237
## 10: 7.155397e-01 9.870812e-01   1238.95286          1.0203875 0.1467152
## 11: 8.494782e-01 9.870812e-01    580.58610          2.3939876 0.3507571
## 12: 7.138278e-01 9.870812e-01    211.41217          3.7567567 0.5936810
## 13: 7.567665e-03 4.378219e-01    233.66349          1.2160593 0.2119072
## 14: 8.509126e-01 9.870812e-01    178.22700          1.5935479 0.2838431
## 15: 9.447903e-01 9.907913e-01    167.93732          1.4268962 0.2552159
## 16: 2.712051e-02 6.794866e-01    108.20576          1.6450553 0.2965825
## 17: 1.742395e-01 9.482795e-01   1044.86776          1.0267218 0.1875049
## 18: 5.594124e-01 9.736222e-01     44.82224          2.7743147 0.5119175
## 19: 9.583299e-02 8.888402e-01     12.60491          3.7786340 0.7360712
## 20: 9.296574e-01 9.907133e-01    141.43553          2.7262524 0.5467931
## 21: 3.785967e-01 9.689222e-01     85.14754          3.1669690 0.6432364
## 22: 4.786390e-01 9.698422e-01     46.57683          3.4265100 0.6973173
## 23: 9.521105e-01 9.907913e-01    788.65322          2.3881438 0.5142084
## 24: 7.129283e-02 8.294639e-01   1895.62576          0.7141773 0.1543440
## 25: 4.024293e-03 3.552853e-01    662.10575          0.8154144 0.1779698
## 26: 6.492115e-01 9.817111e-01   2521.19419          0.5801206 0.1282854
## 27: 9.133659e-01 9.870812e-01    118.92478          0.9405782 0.2134512
## 28: 2.673622e-02 6.794866e-01    435.15065          0.8122893 0.1855795
## 29: 9.744442e-01 9.933745e-01    115.05123          3.4322679 0.8402144
## 30: 6.122510e-01 9.736222e-01     90.04445          1.2341729 0.3037951
## 31: 5.204874e-15 1.604663e-11   2894.50190          0.9432076 0.2338696
## 32: 6.449016e-01 9.816918e-01    678.76669          0.8247570 0.2056418
## 33: 8.772191e-01 9.870812e-01   1904.80208          0.4793197 0.1202933
## 34: 2.590514e-02 6.768266e-01   1348.58134          0.8261638 0.2077193
## 35: 7.501816e-01 9.870812e-01   3058.99570          0.5712487 0.1444503
## 36: 7.164262e-01 9.870812e-01    434.67609          0.8875687 0.2268132
## 37: 3.931812e-01 9.689222e-01   2915.60142          0.8537403 0.2194243
## 38: 7.484219e-01 9.870812e-01    191.24700          0.8892945 0.2315344
## 39: 7.160244e-01 9.870812e-01    153.41072          0.8207968 0.2174348
## 40: 9.720003e-02 8.945304e-01    365.69505          0.7770848 0.2063369
## 41: 1.118483e-01 9.189054e-01   1406.70664          0.7246662 0.1943641
## 42: 9.033917e-01 9.870812e-01     40.71196          1.1386023 0.3074569
## 43: 6.981776e-01 9.870812e-01   5401.14622          0.3827750 0.1046490
## 44: 3.423973e-02 7.098245e-01    368.20221          0.5785412 0.1581023
## 45: 6.770515e-02 8.288503e-01   1467.60567          0.6781832 0.1929750
## 46: 5.252913e-01 9.736222e-01    222.72296          0.6673965 0.1901705
## 47: 1.683001e-01 9.482795e-01     47.21230          1.1935293 0.3414125
## 48: 1.926236e-02 5.822143e-01    284.94188          0.6885801 0.1974524
## 49: 6.442966e-02 8.242184e-01    307.73628          4.0803106 1.1745422
## 50: 7.668629e-03 4.378219e-01    142.29750          0.8914529 0.2563639
## 51: 2.204108e-01 9.611408e-01    562.87698          0.5791271 0.1666735
## 52: 6.384504e-01 9.801957e-01    586.11481          0.8284158 0.2428123
## 53: 5.233884e-01 9.736222e-01   1957.42374          0.7267047 0.2126765
## 54: 4.278429e-03 3.552853e-01     70.70710          2.4129872 0.7068616
## 55: 9.145122e-01 9.870812e-01   1503.75650          0.4700124 0.1400106
## 56: 6.160081e-01 9.737636e-01    329.44287          0.7679538 0.2290587
## 57: 5.099129e-01 9.722088e-01    123.42130          0.9084750 0.2716072
## 58: 5.747042e-01 9.736222e-01    229.35174          0.8379460 0.2516581
## 59: 3.426298e-07 2.640819e-04   1947.26109          1.1084377 0.3360874
## 60: 7.111651e-01 9.870812e-01   5202.86425          0.5168530 0.1575458
## 61: 5.501105e-01 9.736222e-01   2773.65416          0.6132386 0.1890173
## 62: 2.416144e-01 9.689222e-01    216.50234          0.6613622 0.2040039
## 63: 3.776257e-01 9.689222e-01   1002.50477          0.7595524 0.2387205
## 64: 4.186505e-01 9.689222e-01  17913.09774          0.7837300 0.2469454
## 65: 3.119485e-02 6.918974e-01     20.65486          1.7962088 0.5700606
## 66: 4.694104e-01 9.698422e-01    178.98499          0.6220528 0.1977536
## 67: 1.866135e-01 9.502169e-01    321.55470          0.7416514 0.2363632
## 68: 3.430550e-02 7.098245e-01   1662.77983          0.7723207 0.2476475
## 69: 4.784779e-02 7.930900e-01     58.44438          2.2710789 0.7291812
## 70: 2.604887e-01 9.689222e-01   1524.43731          0.7088486 0.2276840
## 71: 8.617834e-02 8.682608e-01    118.20997          0.8646388 0.2780591
## 72: 1.324021e-02 5.193054e-01    632.50302          3.9797553 1.2967992
## 73: 5.549047e-02 8.111132e-01     47.04641          1.0847525 0.3602852
## 74: 6.604872e-01 9.865708e-01     31.68185          1.3212055 0.4397593
## 75: 1.956134e-01 9.542091e-01    247.02378          0.8824329 0.2950649
## 76: 1.982563e-01 9.542091e-01   1077.49391          0.7967718 0.2665855
## 77: 8.121116e-02 8.603918e-01     16.88948          2.4148539 0.8138736
## 78: 2.689866e-02 6.794866e-01   1019.70234          0.6352913 0.2151675
## 79: 4.709049e-01 9.698422e-01    231.85853          0.6983024 0.2366130
## 80: 1.756309e-03 2.461227e-01     31.49301          2.5235537 0.8603015
## 81: 6.799483e-03 4.367251e-01   1486.16130          0.9977611 0.3401257
## 82: 8.223946e-02 8.611549e-01   8245.98592          1.1616243 0.3969708
## 83: 5.772803e-01 9.736222e-01    267.27633          0.7590889 0.2600455
## 84: 2.234911e-02 6.207415e-01    390.22242          0.6106695 0.2092236
## 85: 9.700653e-01 9.920493e-01     12.59049          2.9519130 1.0252204
## 86: 3.653401e-01 9.689222e-01   3512.64956          0.4148728 0.1440410
## 87: 8.321190e-02 8.611549e-01    297.46680          0.7842615 0.2737452
## 88: 8.959826e-02 8.728666e-01    133.54497          0.7047614 0.2473416
## 89: 1.298484e-01 9.440227e-01    823.47924          3.2991171 1.1653831
## 90: 1.342052e-02 5.193054e-01    483.11542          0.6831699 0.2413572
## 91: 4.943835e-01 9.698422e-01  14031.73574          0.6953237 0.2454618
## 92: 9.505588e-01 9.907913e-01    499.90212          0.9587944 0.3398081
## 93: 3.258321e-01 9.689222e-01   1351.55482          0.4148225 0.1471502
## 94: 7.656483e-01 9.870812e-01    149.34261          0.7219507 0.2587788
## 95: 8.418762e-01 9.870812e-01   3742.23209          0.6019944 0.2161566
## 96: 8.051532e-02 8.589229e-01  11842.73298          1.0174993 0.3651491
##        pvalue_Ac      padj_Ac baseMean_Agm log2FoldChange_Agm lfcSE_Agm
##      stat_Agm    pvalue_Agm      padj_Agm baseMean_Arg log2FoldChange_Arg
##  1: 29.421455 2.919776e-190 8.300922e-187  16914.67340        -0.48546377
##  2: 26.959245 4.444603e-160 6.318003e-157  12293.10163        -0.15748791
##  3: 25.561948 4.044059e-144 3.832420e-141  29542.26098        -0.26098373
##  4: 19.559874  3.399155e-85  2.415949e-82  13734.46709        -0.67197146
##  5: 15.779898  4.278811e-56  2.432932e-53    199.76560        -0.34320195
##  6: 13.273570  3.295019e-40  1.561290e-37   3219.13946        -0.66499914
##  7:  9.996223  1.583209e-23  5.626328e-21    690.44979        -0.10489576
##  8:  8.714886  2.910508e-18  8.274575e-16     85.90542        -0.45278173
##  9:  8.001820  1.225935e-15  3.168484e-13    226.50931        -0.10008908
## 10:  6.954885  3.528508e-12  8.359625e-10   1238.95286        -0.11756794
## 11:  6.825201  8.780223e-12  1.920167e-09    580.58610        -0.21944981
## 12:  6.327905  2.485127e-10  4.710144e-08    211.41217         1.38951723
## 13:  5.738640  9.543993e-09  1.596092e-06    233.66349        -0.26886610
## 14:  5.614186  1.974901e-08  3.119247e-06    178.22700        -0.56880715
## 15:  5.590937  2.258478e-08  3.379396e-06    167.93732         0.28172683
## 16:  5.546703  2.911064e-08  4.138078e-06    108.20576        -0.16471928
## 17:  5.475707  4.357687e-08  5.899478e-06   1044.86776         0.25823726
## 18:  5.419456  5.978059e-08  7.725282e-06     44.82224         0.66910130
## 19:  5.133517  2.843771e-07  3.233936e-05     12.60491        -0.20704552
## 20:  4.985894  6.167590e-07  6.744022e-05    141.43553        -0.34948004
## 21:  4.923492  8.501338e-07  8.951594e-05     85.14754        -0.72704696
## 22:  4.913846  8.930688e-07  9.067838e-05     46.57683         1.12178846
## 23:  4.644311  3.412132e-06  3.031466e-04    788.65322         0.14633147
## 24:  4.627180  3.706780e-06  3.193447e-04   1895.62576         0.15837154
## 25:  4.581758  4.610836e-06  3.745316e-04    662.10575        -0.01033058
## 26:  4.522108  6.122675e-06  4.704531e-04   2521.19419         0.51512200
## 27:  4.406526  1.050416e-05  7.657262e-04    118.92478        -0.14475536
## 28:  4.377043  1.203003e-05  8.341799e-04    435.15065         0.20672001
## 29:  4.084990  4.407865e-05  2.610741e-03    115.05123        -0.44673651
## 30:  4.062518  4.854617e-05  2.816669e-03     90.04445        -1.19623240
## 31:  4.033050  5.505753e-05  3.130571e-03   2894.50190        -1.85490521
## 32:  4.010649  6.055213e-05  3.375484e-03    678.76669         0.08026372
## 33:  3.984591  6.759650e-05  3.625978e-03   1904.80208        -0.16149751
## 34:  3.977310  6.969937e-05  3.669543e-03   1348.58134         0.17791800
## 35:  3.954640  7.665001e-05  3.891357e-03   3058.99570         0.07940210
## 36:  3.913214  9.107588e-05  4.464288e-03    434.67609        -0.15028633
## 37:  3.890820  9.990612e-05  4.742977e-03   2915.60142         1.18531603
## 38:  3.840874  1.225970e-04  5.713823e-03    191.24700        -0.30736683
## 39:  3.774910  1.600655e-04  7.223271e-03    153.41072         0.37644603
## 40:  3.766097  1.658193e-04  7.366006e-03    365.69505        -0.06608476
## 41:  3.728396  1.927026e-04  8.056669e-03   1406.70664         0.42323649
## 42:  3.703291  2.128209e-04  8.713129e-03     40.71196        -0.48270063
## 43:  3.657704  2.544848e-04  9.646672e-03   5401.14622         0.42165362
## 44:  3.659285  2.529203e-04  9.646672e-03    368.20221         0.06148517
## 45:  3.514358  4.408175e-04  1.606723e-02   1467.60567        -0.18747702
## 46:  3.509464  4.490116e-04  1.615873e-02    222.72296        -0.09036442
## 47:  3.495857  4.725415e-04  1.679294e-02     47.21230        -0.15675697
## 48:  3.487322  4.878835e-04  1.691855e-02    284.94188         0.40341890
## 49:  3.473958  5.128405e-04  1.715301e-02    307.73628         1.16895273
## 50:  3.477295  5.065001e-04  1.715301e-02    142.29750         0.02750749
## 51:  3.474621  5.115757e-04  1.715301e-02    562.87698         0.18748568
## 52:  3.411754  6.454638e-04  1.973176e-02    586.11481        -0.04773224
## 53:  3.416950  6.332698e-04  1.973176e-02   1957.42374         0.25690546
## 54:  3.413663  6.409578e-04  1.973176e-02     70.70710         0.81072127
## 55:  3.356978  7.879933e-04  2.383261e-02   1503.75650         0.08485519
## 56:  3.352651  8.004165e-04  2.395352e-02    329.44287         0.34758135
## 57:  3.344812  8.233823e-04  2.438413e-02    123.42130        -0.36950177
## 58:  3.329700  8.693952e-04  2.548135e-02    229.35174         0.76658048
## 59:  3.298063  9.735417e-04  2.767779e-02   1947.26109        -1.26417211
## 60:  3.280653  1.035671e-03  2.915261e-02   5202.86425         0.28368758
## 61:  3.244352  1.177182e-03  3.245707e-02   2773.65416         0.21009197
## 62:  3.241910  1.187315e-03  3.245707e-02    216.50234        -0.09714172
## 63:  3.181764  1.463808e-03  3.889352e-02   1002.50477         0.17331584
## 64:  3.173698  1.505101e-03  3.962039e-02  17913.09774         0.89910247
## 65:  3.150909  1.627634e-03  4.168795e-02     20.65486         1.15353409
## 66:  3.145596  1.657489e-03  4.207359e-02    178.98499         0.15252178
## 67:  3.137761  1.702434e-03  4.283204e-02    321.55470        -0.25320449
## 68:  3.118629  1.816946e-03  4.491806e-02   1662.77983         0.36420990
## 69:  3.114560  1.842193e-03  4.495540e-02     58.44438         0.78253092
## 70:  3.113300  1.850081e-03  4.495540e-02   1524.43731         0.60513306
## 71:  3.109550  1.873723e-03  4.514403e-02    118.20997        -0.08663498
## 72:  3.068906  2.148439e-03  5.047944e-02    632.50302         1.63619419
## 73:  3.010816  2.605468e-03  6.071594e-02     47.04641         0.19031444
## 74:  3.004383  2.661200e-03  6.151050e-02     31.68185        -0.56425410
## 75:  2.990640  2.783933e-03  6.319391e-02    247.02378         0.05136048
## 76:  2.988804  2.800715e-03  6.319391e-02   1077.49391         0.51740109
## 77:  2.967112  3.006116e-03  6.670738e-02     16.88948         0.58570172
## 78:  2.952543  3.151685e-03  6.714943e-02   1019.70234         0.29971749
## 79:  2.951243  3.164975e-03  6.714943e-02    231.85853         0.32622241
## 80:  2.933336  3.353403e-03  7.010093e-02     31.49301         0.89739442
## 81:  2.933507  3.351565e-03  7.010093e-02   1486.16130         0.19300392
## 82:  2.926221  3.431067e-03  7.068496e-02   8245.98592         0.45610545
## 83:  2.919062  3.510865e-03  7.136917e-02    267.27633        -0.07357072
## 84:  2.918741  3.514486e-03  7.136917e-02    390.22242         0.19256171
## 85:  2.879296  3.985639e-03  7.979699e-02     12.59049        -0.54979958
## 86:  2.880241  3.973707e-03  7.979699e-02   3512.64956         0.24312082
## 87:  2.864932  4.170983e-03  8.292381e-02    297.46680         0.12635602
## 88:  2.849344  4.380944e-03  8.589672e-02    133.54497         0.26860837
## 89:  2.830929  4.641297e-03  8.749320e-02    823.47924         1.11405432
## 90:  2.830535  4.647018e-03  8.749320e-02    483.11542         0.29399185
## 91:  2.832716  4.615434e-03  8.749320e-02  14031.73574         0.24220580
## 92:  2.821576  4.778828e-03  8.938295e-02    499.90212         0.46049581
## 93:  2.819042  4.816723e-03  8.950289e-02   1351.55482         0.38481381
## 94:  2.789837  5.273458e-03  9.610539e-02    149.34261        -0.22158244
## 95:  2.784992  5.352907e-03  9.631845e-02   3742.23209         0.01685585
## 96:  2.786531  5.327550e-03  9.631845e-02  11842.73298         0.52904337
##      stat_Agm    pvalue_Agm      padj_Agm baseMean_Arg log2FoldChange_Arg
##     lfcSE_Arg    stat_Arg   pvalue_Arg     padj_Arg                 ID
##  1: 0.2277469 -2.13159313 3.304031e-02 6.304304e-01 cds-WP_009306487.1
##  2: 0.2535301 -0.62118021 5.344811e-01 9.981163e-01 cds-WP_015760997.1
##  3: 0.2677521 -0.97472142 3.296985e-01 9.981163e-01 cds-WP_009306489.1
##  4: 0.3357023 -2.00168848 4.531825e-02 7.181071e-01 cds-WP_009306488.1
##  5: 0.3184411 -1.07775651 2.811424e-01 9.981163e-01 cds-WP_015760089.1
##  6: 0.3209880 -2.07172607 3.829099e-02 6.760932e-01 cds-WP_009608343.1
##  7: 0.2755431 -0.38068736 7.034353e-01 9.981163e-01 cds-WP_009608299.1
##  8: 0.4079928 -1.10977866 2.670944e-01 9.981163e-01 cds-WP_041691603.1
##  9: 0.2310042 -0.43327818 6.648127e-01 9.981163e-01 cds-WP_015760505.1
## 10: 0.1478345 -0.79526736 4.264580e-01 9.981163e-01 cds-WP_015760725.1
## 11: 0.3537338 -0.62038127 5.350068e-01 9.981163e-01 cds-WP_009608276.1
## 12: 0.5970877  2.32715762 1.995688e-02 4.970313e-01   cds-ELEN_RS10965
## 13: 0.2182094 -1.23214727 2.178941e-01 9.981163e-01 cds-WP_009304592.1
## 14: 0.2935322 -1.93780130 5.264747e-02 7.595360e-01 cds-WP_015760309.1
## 15: 0.2594987  1.08565777 2.776304e-01 9.981163e-01 cds-WP_009304577.1
## 16: 0.3085908 -0.53377893 5.934945e-01 9.981163e-01 cds-WP_015759803.1
## 17: 0.1880997  1.37287462 1.697913e-01 9.953376e-01 cds-WP_009609101.1
## 18: 0.5286418  1.26569892 2.056209e-01           NA cds-WP_009306370.1
## 19: 0.8846209 -0.23404999 8.149462e-01           NA cds-WP_143924731.1
## 20: 0.5573020 -0.62709275 5.305984e-01 9.981163e-01 cds-WP_009307191.1
## 21: 0.6693344 -1.08622385 2.773800e-01 9.981163e-01 cds-WP_009307188.1
## 22: 0.7103844  1.57912882 1.143065e-01           NA cds-WP_015760994.1
## 23: 0.5153142  0.28396553 7.764368e-01 9.981163e-01 cds-WP_009608270.1
## 24: 0.1546064  1.02435330 3.056684e-01 9.981163e-01 cds-WP_009304445.1
## 25: 0.1791970 -0.05764930 9.540280e-01 9.981163e-01 cds-WP_015761042.1
## 26: 0.1282026  4.01803091 5.868650e-05 8.389060e-03 cds-WP_009609314.1
## 27: 0.2209466 -0.65515990 5.123648e-01 9.981163e-01 cds-WP_009304367.1
## 28: 0.1866718  1.10739817 2.681218e-01 9.981163e-01 cds-WP_015760771.1
## 29: 0.8539656 -0.52313175 6.008826e-01 9.981163e-01 cds-WP_009307190.1
## 30: 0.3282655 -3.64410047 2.683286e-04 2.676352e-02 cds-WP_015761223.1
## 31: 0.2362325 -7.85203309 4.093464e-15 9.685137e-12 cds-WP_015760428.1
## 32: 0.2064645  0.38875307 6.974588e-01 9.981163e-01 cds-WP_009305269.1
## 33: 0.1207271 -1.33770760 1.809918e-01 9.953376e-01 cds-WP_009305225.1
## 34: 0.2080702  0.85508643 3.925033e-01 9.981163e-01 cds-WP_009306854.1
## 35: 0.1445917  0.54914703 5.829045e-01 9.981163e-01 cds-WP_015760502.1
## 36: 0.2286897 -0.65716264 5.110763e-01 9.981163e-01 cds-WP_009609472.1
## 37: 0.2192737  5.40564549 6.457541e-08 6.869824e-05 cds-WP_009306171.1
## 38: 0.2365595 -1.29932172 1.938335e-01 9.970957e-01 cds-WP_015760661.1
## 39: 0.2189289  1.71949012 8.552517e-02 9.221619e-01 cds-WP_009607965.1
## 40: 0.2082789 -0.31728975 7.510238e-01 9.981163e-01 cds-WP_009608487.1
## 41: 0.1944406  2.17668781 2.950387e-02 6.133378e-01 cds-WP_012809455.1
## 42: 0.3334149 -1.44774742 1.476877e-01           NA cds-WP_015760088.1
## 43: 0.1045613  4.03259634 5.516399e-05 8.389060e-03 cds-WP_009609026.1
## 44: 0.1593499  0.38585000 6.996078e-01 9.981163e-01 cds-WP_009306853.1
## 45: 0.1935318 -0.96871412 3.326878e-01 9.981163e-01 cds-WP_015760415.1
## 46: 0.1930031 -0.46820190 6.396402e-01 9.981163e-01 cds-WP_009306899.1
## 47: 0.3577966 -0.43811760 6.613010e-01           NA cds-WP_009307168.1
## 48: 0.1977950  2.03958124 4.139205e-02 7.080976e-01 cds-WP_015760768.1
## 49: 1.1765700  0.99352589 3.204537e-01 9.981163e-01 cds-WP_015760001.1
## 50: 0.2606590  0.10553057 9.159548e-01 9.981163e-01 cds-WP_015760777.1
## 51: 0.1671193  1.12186742 2.619188e-01 9.981163e-01 cds-WP_015761031.1
## 52: 0.2438457 -0.19574777 8.448076e-01 9.981163e-01 cds-WP_009304439.1
## 53: 0.2128050  1.20723435 2.273419e-01 9.981163e-01 cds-WP_015760818.1
## 54: 0.7136270  1.13605752 2.559325e-01 9.981163e-01 cds-WP_015760273.1
## 55: 0.1402003  0.60524255 5.450178e-01 9.981163e-01 cds-WP_015761231.1
## 56: 0.2296526  1.51350925 1.301504e-01 9.880657e-01 cds-WP_009304580.1
## 57: 0.2791819 -1.32351642 1.856637e-01 9.953376e-01 cds-WP_009609042.1
## 58: 0.2512512  3.05105209 2.280410e-03 1.315963e-01 cds-WP_009608183.1
## 59: 0.3376270 -3.74428571 1.809077e-04 2.140138e-02 cds-WP_015760431.1
## 60: 0.1575540  1.80057330 7.177016e-02 8.578723e-01 cds-WP_197054159.1
## 61: 0.1890986  1.11101839 2.665604e-01 9.981163e-01 cds-WP_009305983.1
## 62: 0.2066817 -0.47000644 6.383504e-01 9.981163e-01 cds-WP_009304249.1
## 63: 0.2390419  0.72504379 4.684252e-01 9.981163e-01 cds-WP_015760816.1
## 64: 0.2469319  3.64109479 2.714812e-04 2.676352e-02 cds-WP_009306172.1
## 65: 0.5773556  1.99796119 4.572087e-02           NA cds-WP_015759959.1
## 66: 0.1994192  0.76482984 4.443729e-01 9.981163e-01 cds-WP_015761045.1
## 67: 0.2388482 -1.06010639 2.890962e-01 9.981163e-01 cds-WP_015760486.1
## 68: 0.2477559  1.47003523 1.415522e-01 9.880657e-01 cds-WP_009305984.1
## 69: 0.7356906  1.06366848 2.874789e-01           NA cds-WP_015759916.1
## 70: 0.2276287  2.65842216 7.850748e-03 2.982349e-01 cds-WP_015761216.1
## 71: 0.2833748 -0.30572579 7.598134e-01 9.981163e-01 cds-WP_015760779.1
## 72: 1.2974969  1.26103895 2.072948e-01 9.981163e-01 cds-WP_015759849.1
## 73: 0.3694267  0.51516164 6.064401e-01           NA cds-WP_041691663.1
## 74: 0.4695664 -1.20164927 2.294994e-01           NA cds-WP_015760086.1
## 75: 0.2969805  0.17294228 8.626968e-01 9.981163e-01 cds-WP_009306869.1
## 76: 0.2666411  1.94044005 5.232623e-02 7.595329e-01 cds-WP_009305361.1
## 77: 0.8348399  0.70157372 4.829450e-01           NA cds-WP_009306369.1
## 78: 0.2153034  1.39207019 1.639011e-01 9.953376e-01 cds-WP_015759984.1
## 79: 0.2372716  1.37489048 1.691654e-01 9.953376e-01 cds-WP_009306933.1
## 80: 0.8749767  1.02562099 3.050703e-01           NA cds-WP_015760251.1
## 81: 0.3404074  0.56697916 5.707283e-01 9.981163e-01 cds-WP_015761318.1
## 82: 0.3970030  1.14887148 2.506090e-01 9.981163e-01 cds-WP_015761320.1
## 83: 0.2620588 -0.28074123 7.789089e-01 9.981163e-01 cds-WP_009306895.1
## 84: 0.2098313  0.91769785 3.587771e-01 9.981163e-01 cds-WP_015761458.1
## 85: 1.1064309 -0.49691270 6.192506e-01           NA cds-WP_009307189.1
## 86: 0.1440289  1.68800034 9.141116e-02 9.221619e-01 cds-WP_009608482.1
## 87: 0.2750036  0.45947039 6.458964e-01 9.981163e-01 cds-WP_015760150.1
## 88: 0.2489308  1.07904837 2.805662e-01 9.981163e-01 cds-WP_015760212.1
## 89: 1.1658487  0.95557370 3.392877e-01 9.981163e-01 cds-WP_015760348.1
## 90: 0.2417218  1.21624068 2.238932e-01 9.981163e-01 cds-WP_009304701.1
## 91: 0.2454771  0.98667362 3.238027e-01 9.981163e-01 cds-WP_158539336.1
## 92: 0.3401422  1.35383305 1.757896e-01 9.953376e-01 cds-WP_015760817.1
## 93: 0.1469714  2.61829034 8.837158e-03 3.120704e-01 cds-WP_015759835.1
## 94: 0.2630337 -0.84241084 3.995580e-01 9.981163e-01 cds-WP_015760386.1
## 95: 0.2162594  0.07794274 9.378736e-01 9.981163e-01 cds-WP_114522544.1
## 96: 0.3651629  1.44878748 1.473969e-01 9.880657e-01 cds-WP_015761300.1
##     lfcSE_Arg    stat_Arg   pvalue_Arg     padj_Arg                 ID
##                Parent        Name2
##  1: gene-ELEN_RS03400         aguA
##  2: gene-ELEN_RS11010         ptcA
##  3: gene-ELEN_RS03390         ptcA
##  4: gene-ELEN_RS03395 ELEN_RS03395
##  5: gene-ELEN_RS03380 ELEN_RS03380
##  6: gene-ELEN_RS06445 ELEN_RS06445
##  7: gene-ELEN_RS06450 ELEN_RS06450
##  8: gene-ELEN_RS03410 ELEN_RS03410
##  9: gene-ELEN_RS06485 ELEN_RS06485
## 10: gene-ELEN_RS08500 ELEN_RS08500
## 11: gene-ELEN_RS09695 ELEN_RS09695
## 12: gene-ELEN_RS10965 ELEN_RS10965
## 13: gene-ELEN_RS06405 ELEN_RS06405
## 14: gene-ELEN_RS04815          bfr
## 15: gene-ELEN_RS06480 ELEN_RS06480
## 16: gene-ELEN_RS00415 ELEN_RS00415
## 17: gene-ELEN_RS14490 ELEN_RS14490
## 18: gene-ELEN_RS10980 ELEN_RS10980
## 19: gene-ELEN_RS16125 ELEN_RS16125
## 20: gene-ELEN_RS08985         dltA
## 21: gene-ELEN_RS08970         dltD
## 22: gene-ELEN_RS10970 ELEN_RS10970
## 23: gene-ELEN_RS09690 ELEN_RS09690
## 24: gene-ELEN_RS07075 ELEN_RS07075
## 25: gene-ELEN_RS11380 ELEN_RS11380
## 26: gene-ELEN_RS13605 ELEN_RS13605
## 27: gene-ELEN_RS09120 ELEN_RS09120
## 28: gene-ELEN_RS08840 ELEN_RS08840
## 29: gene-ELEN_RS08980         dltB
## 30: gene-ELEN_RS12535 ELEN_RS12535
## 31: gene-ELEN_RS05810 ELEN_RS05810
## 32: gene-ELEN_RS14575 ELEN_RS14575
## 33: gene-ELEN_RS14370 ELEN_RS14370
## 34: gene-ELEN_RS13710 ELEN_RS13710
## 35: gene-ELEN_RS06440          nth
## 36: gene-ELEN_RS03025 ELEN_RS03025
## 37: gene-ELEN_RS02800 ELEN_RS02800
## 38: gene-ELEN_RS08010         wecB
## 39: gene-ELEN_RS02230 ELEN_RS02230
## 40: gene-ELEN_RS15305 ELEN_RS15305
## 41: gene-ELEN_RS00080 ELEN_RS00080
## 42: gene-ELEN_RS03375         arcC
## 43: gene-ELEN_RS00740 ELEN_RS00740
## 44: gene-ELEN_RS13705 ELEN_RS13705
## 45: gene-ELEN_RS05635 ELEN_RS05635
## 46: gene-ELEN_RS13960 ELEN_RS13960
## 47: gene-ELEN_RS08750 ELEN_RS08750
## 48: gene-ELEN_RS08825 ELEN_RS08825
## 49: gene-ELEN_RS02360 ELEN_RS02360
## 50: gene-ELEN_RS08870 ELEN_RS08870
## 51: gene-ELEN_RS11325 ELEN_RS11325
## 52: gene-ELEN_RS07090 ELEN_RS07090
## 53: gene-ELEN_RS09355 ELEN_RS09355
## 54: gene-ELEN_RS15695 ELEN_RS15695
## 55: gene-ELEN_RS12650 ELEN_RS12650
## 56: gene-ELEN_RS06465 ELEN_RS06465
## 57: gene-ELEN_RS14175 ELEN_RS14175
## 58: gene-ELEN_RS02795 ELEN_RS02795
## 59: gene-ELEN_RS05825 ELEN_RS05825
## 60: gene-ELEN_RS10000         ftsE
## 61: gene-ELEN_RS01955 ELEN_RS01955
## 62: gene-ELEN_RS09475 ELEN_RS09475
## 63: gene-ELEN_RS09345         nrfD
## 64: gene-ELEN_RS02805 ELEN_RS02805
## 65: gene-ELEN_RS01995 ELEN_RS01995
## 66: gene-ELEN_RS11395         crtI
## 67: gene-ELEN_RS06210 ELEN_RS06210
## 68: gene-ELEN_RS01960 ELEN_RS01960
## 69: gene-ELEN_RS01635 ELEN_RS01635
## 70: gene-ELEN_RS12485 ELEN_RS12485
## 71: gene-ELEN_RS08880 ELEN_RS08880
## 72: gene-ELEN_RS00855 ELEN_RS00855
## 73: gene-ELEN_RS12410 ELEN_RS12410
## 74: gene-ELEN_RS03365 ELEN_RS03365
## 75: gene-ELEN_RS13795 ELEN_RS13795
## 76: gene-ELEN_RS15060 ELEN_RS15060
## 77: gene-ELEN_RS10975 ELEN_RS10975
## 78: gene-ELEN_RS02210 ELEN_RS02210
## 79: gene-ELEN_RS07660 ELEN_RS07660
## 80: gene-ELEN_RS04430 ELEN_RS04430
## 81: gene-ELEN_RS16350 ELEN_RS16350
## 82: gene-ELEN_RS16360 ELEN_RS16360
## 83: gene-ELEN_RS13940 ELEN_RS13940
## 84: gene-ELEN_RS14660 ELEN_RS14660
## 85: gene-ELEN_RS08975         dltC
## 86: gene-ELEN_RS15425         galE
## 87: gene-ELEN_RS03880 ELEN_RS03880
## 88: gene-ELEN_RS04215 ELEN_RS04215
## 89: gene-ELEN_RS05075 ELEN_RS05075
## 90: gene-ELEN_RS05790 ELEN_RS05790
## 91: gene-ELEN_RS10280 ELEN_RS10280
## 92: gene-ELEN_RS09350 ELEN_RS09350
## 93: gene-ELEN_RS00780 ELEN_RS00780
## 94: gene-ELEN_RS05310 ELEN_RS05310
## 95: gene-ELEN_RS10275 ELEN_RS10275
## 96: gene-ELEN_RS13165 ELEN_RS13165
##                Parent        Name2
##                                                              product
##  1:                                               agmatine deiminase
##  2:                                  putrescine carbamoyltransferase
##  3:                                  putrescine carbamoyltransferase
##  4:                                              APC family permease
##  5:                          oligosaccharide flippase family protein
##  6:                                                   amidohydrolase
##  7:                       helix-turn-helix transcriptional regulator
##  8:                                 DUF559 domain-containing protein
##  9: polysaccharide biosynthesis C-terminal domain-containing protein
## 10:                                              aldo/keto reductase
## 11:                                             hypothetical protein
## 12:                 amino acid adenylation domain-containing protein
## 13:                                            DUF488 family protein
## 14:                                                 bacterioferritin
## 15:                            MarR family transcriptional regulator
## 16:                            protease inhibitor I42 family protein
## 17:                                   MATE family efflux transporter
## 18:                                             MBOAT family protein
## 19:                                             hypothetical protein
## 20:              D-alanine--poly(phosphoribitol) ligase subunit DltA
## 21:             D-alanyl-lipoteichoic acid biosynthesis protein DltD
## 22:                                                 alanine racemase
## 23:                      sigma-70 family RNA polymerase sigma factor
## 24:                          response regulator transcription factor
## 25:                                             hypothetical protein
## 26:                                                  MFS transporter
## 27:                                DUF1269 domain-containing protein
## 28:                                             hypothetical protein
## 29:             D-alanyl-lipoteichoic acid biosynthesis protein DltB
## 30:                         histidine decarboxylase%2C pyruvoyl type
## 31:       lantibiotic protection ABC transporter ATP-binding protein
## 32:                                       phage holin family protein
## 33:                          response regulator transcription factor
## 34:                                Cof-type HAD-IIB family hydrolase
## 35:                                                 endonuclease III
## 36:                                              radical SAM protein
## 37:                       helix-turn-helix domain-containing protein
## 38:            UDP-N-acetylglucosamine 2-epimerase (non-hydrolyzing)
## 39:                           molybdopterin-dependent oxidoreductase
## 40:                                DUF3365 domain-containing protein
## 41:                   ATP-binding cassette domain-containing protein
## 42:                                                 carbamate kinase
## 43:                                    glucose-6-phosphate isomerase
## 44:                                    nitroreductase family protein
## 45:                   amino acid ABC transporter ATP-binding protein
## 46:                           molybdopterin-dependent oxidoreductase
## 47:                                             hypothetical protein
## 48:                                             hypothetical protein
## 49:                       helix-turn-helix transcriptional regulator
## 50:                                             hypothetical protein
## 51:                                          L-lactate dehydrogenase
## 52:                                         ABC transporter permease
## 53:                           molybdopterin-dependent oxidoreductase
## 54:                                             hypothetical protein
## 55:                                                acetyltransferase
## 56:                                              SdpI family protein
## 57:                                     FAD-dependent oxidoreductase
## 58:                                 InlB B-repeat-containing protein
## 59:                          response regulator transcription factor
## 60:                           cell division ATP-binding protein FtsE
## 61:                                             C40 family peptidase
## 62:                                   MATE family efflux transporter
## 63:                                       polysulfide reductase NrfD
## 64:                                         ABC transporter permease
## 65:                           molybdopterin-dependent oxidoreductase
## 66:                                              phytoene desaturase
## 67:                                               response regulator
## 68:                                 NAD(P)H-dependent oxidoreductase
## 69:                                DUF1062 domain-containing protein
## 70:                                       MDR family MFS transporter
## 71:                                             hypothetical protein
## 72:                                                  MFS transporter
## 73:                                             hypothetical protein
## 74:                                              APC family permease
## 75:                       helix-turn-helix domain-containing protein
## 76:                           LytTR family transcriptional regulator
## 77:                               phosphopantetheine-binding protein
## 78:                                              YdcF family protein
## 79:                                  metallopeptidase family protein
## 80:                                             hypothetical protein
## 81:                                             hypothetical protein
## 82:                                             C39 family peptidase
## 83:                                       magnesium transporter CorA
## 84:                LuxR C-terminal-related transcriptional regulator
## 85:              D-alanine--poly(phosphoribitol) ligase subunit DltC
## 86:                                     UDP-glucose 4-epimerase GalE
## 87:                                   HAMP domain-containing protein
## 88:                                             hypothetical protein
## 89:                                           NAD(P)-binding protein
## 90:                            TetR family transcriptional regulator
## 91:                                              glycosyltransferase
## 92:                       4Fe-4S dicluster domain-containing protein
## 93:                       TetR/AcrR family transcriptional regulator
## 94:                                             pirin family protein
## 95:                                DUF2142 domain-containing protein
## 96:                                             hypothetical protein
##                                                              product
##                                                                                                                   old_locus_tag
##  1:                                                                                                                   Elen_0678
##  2:                                                                                                                   Elen_2191
##  3:                                                                                                                   Elen_0676
##  4:                                                                                                                   Elen_0677
##  5:                                                                                                                   Elen_0674
##  6:                                                                                                                   Elen_1290
##  7:                                                                                                                   Elen_1291
##  8: ID=gene-ELEN_RS03410;Dbxref=GeneID:40921510;Name=ELEN_RS03410;gbkey=Gene;gene_biotype=protein_coding;locus_tag=ELEN_RS03410
##  9:                                                                                                                   Elen_1298
## 10:                                                                                                                   Elen_1699
## 11:                                                                                                                   Elen_1936
## 12:                                                                                                                        <NA>
## 13:                                                                                                                   Elen_1282
## 14:                                                                                                                   Elen_0966
## 15:                                                                                                                   Elen_1297
## 16:                                                                                                                   Elen_0077
## 17:                                                                                                                   Elen_2890
## 18:                                                                                                                   Elen_2185
## 19: ID=gene-ELEN_RS16125;Dbxref=GeneID:40923962;Name=ELEN_RS16125;gbkey=Gene;gene_biotype=protein_coding;locus_tag=ELEN_RS16125
## 20:                                                                                                                   Elen_1793
## 21:                                                                                                                   Elen_1790
## 22:                                                                                                                   Elen_2183
## 23:                                                                                                                   Elen_1935
## 24:                                                                                                                   Elen_1415
## 25:                                                                                                                   Elen_2265
## 26:                                                                                                                   Elen_2718
## 27:                                                                                                                   Elen_1820
## 28:                                                                                                                   Elen_1763
## 29:                                                                                                                   Elen_1792
## 30:                                                                                                                   Elen_2499
## 31:                                                                                                                   Elen_1167
## 32:                                                                                                                   Elen_2907
## 33:                                                                                                                   Elen_2866
## 34:                                                                                                                   Elen_2739
## 35:                                                                                                                   Elen_1289
## 36:                                                                                                                   Elen_0601
## 37:                                                                                                                   Elen_0560
## 38:                                                                                                                   Elen_1601
## 39:                                                                                                                   Elen_0442
## 40:                                                                                                                   Elen_3055
## 41:                                                                                                                   Elen_0015
## 42:                                                                                                                   Elen_0673
## 43:                                                                                                                   Elen_0139
## 44:                                                                                                                   Elen_2738
## 45:                                                                                                                   Elen_1133
## 46:                                                                                                                   Elen_2787
## 47:                                                                                                                   Elen_1750
## 48:                                                                                                                   Elen_1760
## 49:                                                                                                                   Elen_0473
## 50:                                                                                                                   Elen_1769
## 51:                                                                                                                   Elen_2253
## 52:                                                                                                                   Elen_1418
## 53:                                                                                                                   Elen_1869
## 54:                                                                                                                   Elen_0913
## 55:                                                                                                                   Elen_2521
## 56:                                                                                                                   Elen_1294
## 57:                                                                                                                   Elen_2826
## 58:                                                                                                                   Elen_0558
## 59:                                                                                                                   Elen_1170
## 60:                                                                                                                   Elen_1996
## 61:                                                                                                                   Elen_0385
## 62:                                                                                                                   Elen_1894
## 63:                                                                                                                   Elen_1867
## 64:                                                                                                                   Elen_0561
## 65:                                                                                                                   Elen_0393
## 66:                                                                                                                   Elen_2268
## 67:                                                                                                                   Elen_1246
## 68:                                                                                                                   Elen_0386
## 69:                                                                                                                   Elen_0319
## 70:                                                                                                                   Elen_2489
## 71:                                                                                                                   Elen_1771
## 72:                                                                                                                   Elen_0162
## 73:                                                                                                                   Elen_2475
## 74:                                                                                                                   Elen_0671
## 75:                                                                                                                   Elen_2755
## 76:                                                                                                                   Elen_3004
## 77:                                                                                                                   Elen_2184
## 78:                                                                                                                   Elen_0438
## 79:                                                                                                                   Elen_1532
## 80:                                                                                                                   Elen_0890
## 81:                                                                                                                   Elen_2645
## 82:                                                                                                                   Elen_2647
## 83:                                                                                                                   Elen_2783
## 84:                                                                                                                   Elen_2925
## 85:                                                                                                                   Elen_1791
## 86:                                                                                                                   Elen_3079
## 87:                                                                                                                   Elen_0777
## 88:                                                                                                                   Elen_0847
## 89:                                                                                                                   Elen_1018
## 90:                                                                                                                   Elen_1164
## 91:                                                                                                                   Elen_2052
## 92:                                                                                                                   Elen_1868
## 93:                                                                                                                   Elen_0147
## 94:                                                                                                                   Elen_1067
## 95:                                                                                                                   Elen_2051
## 96:                                                                                                                   Elen_2627
##                                                                                                                   old_locus_tag
results_all3[padj_Agm < 0.1 & log2FoldChange_Agm < 0][order(padj_Agm)]
##             Gene baseMean_Ac log2FoldChange_Ac  lfcSE_Ac     stat_Ac
##  1: ELEN_RS07845 26646.37979       -0.19535607 0.1760101 -1.10991395
##  2: ELEN_RS07850  3177.87185       -0.06941281 0.1617978 -0.42900973
##  3: ELEN_RS00110  1250.93435       -0.14682127 0.2122940 -0.69159405
##  4: ELEN_RS05065  4904.24380       -0.10114553 0.1471280 -0.68746643
##  5: ELEN_RS13660  4196.85545        0.23758800 0.2884326  0.82372090
##  6: ELEN_RS08445  2306.17402       -0.47426038 0.3340810 -1.41959704
##  7: ELEN_RS15110  9752.29806       -0.20804822 0.1982746 -1.04929350
##  8: ELEN_RS15115 11471.64459       -0.22370178 0.2122913 -1.05374894
##  9: ELEN_RS14380   449.98628       -0.72773358 0.2853311 -2.55048776
## 10: ELEN_RS08430  1129.39297       -0.72378460 0.3535081 -2.04743448
## 11: ELEN_RS13655  9382.59197       -0.01403712 0.3618382 -0.03879392
## 12: ELEN_RS08435   989.30443       -0.71047280 0.3796636 -1.87132190
## 13: ELEN_RS00245   458.06458       -0.26588823 0.1745091 -1.52363506
## 14: ELEN_RS11680  1232.01089       -0.08841344 0.1559462 -0.56694833
## 15: ELEN_RS08455 16364.92983       -0.55028507 0.3855704 -1.42719747
## 16: ELEN_RS00105  1047.01955       -0.03240981 0.2615465 -0.12391606
## 17: ELEN_RS01380   812.21548       -0.76889537 0.3930571 -1.95619245
## 18: ELEN_RS05460  1155.60437        0.15305515 0.1757128  0.87105290
## 19: ELEN_RS14275   197.35820        0.04861685 0.2125113  0.22877305
## 20: ELEN_RS10480   823.57486       -0.70482212 0.2161651 -3.26057371
## 21: ELEN_RS12450  1590.11793        0.31986683 0.1516677  2.10899719
## 22: ELEN_RS13650  2755.41982        0.03101741 0.3130658  0.09907634
## 23: ELEN_RS01930  5095.43554       -0.10597620 0.1680873 -0.63048314
## 24: ELEN_RS11095  4498.87774       -0.02452484 0.1223397 -0.20046515
## 25: ELEN_RS08440  2476.66450       -0.76581246 0.4851076 -1.57864445
## 26: ELEN_RS05170   888.85835       -0.13497878 0.1549399 -0.87116884
## 27: ELEN_RS02115  1485.30285       -0.13951269 0.1303419 -1.07035955
## 28: ELEN_RS02110  1878.69665       -0.11752086 0.1326368 -0.88603535
## 29: ELEN_RS00365 11083.53088       -0.24407110 0.1891008 -1.29069330
## 30: ELEN_RS00970   545.58869       -0.68051765 0.2343863 -2.90340201
## 31: ELEN_RS11675    52.56469       -0.46002968 0.3582171 -1.28422019
## 32: ELEN_RS04880   493.54873       -0.27853648 0.3497809 -0.79631692
## 33: ELEN_RS12420   828.93378       -0.50878736 0.1834011 -2.77417909
## 34: ELEN_RS07805  1201.58279        0.02353834 0.1530601  0.15378497
## 35: ELEN_RS08385   146.71784       -0.11997000 0.2804262 -0.42781306
## 36: ELEN_RS00235   179.83207       -0.22236546 0.2805878 -0.79249863
## 37: ELEN_RS00795   844.00385        0.12275925 0.2298198  0.53415435
## 38: ELEN_RS07100   567.54726       -0.23987576 0.2036772 -1.17772535
## 39: ELEN_RS09105  5996.21729       -0.10580844 0.1827589 -0.57895082
## 40: ELEN_RS12445  2598.12134        0.02999785 0.3024883  0.09917025
## 41: ELEN_RS09100   789.77241       -0.20646453 0.2485286 -0.83074768
## 42: ELEN_RS08410 17810.71321       -0.35981914 0.2025880 -1.77611269
## 43: ELEN_RS14280  9124.54158       -0.27917501 0.2563013 -1.08924561
## 44: ELEN_RS00805   288.02707       -0.32761291 0.2551569 -1.28396671
## 45: ELEN_RS10390 18782.44810       -0.35900090 0.2418283 -1.48452787
## 46: ELEN_RS14295 11522.55028       -0.04223584 0.2420373 -0.17450135
## 47: ELEN_RS10490  4153.04572       -0.48320375 0.1763119 -2.74061953
## 48: ELEN_RS05465  2181.84115       -0.39722606 0.3160805 -1.25672441
## 49: ELEN_RS14285 10685.98938       -0.48716568 0.3205054 -1.51999234
## 50: ELEN_RS11070  1636.55576       -0.55226433 0.2536261 -2.17747423
## 51: ELEN_RS08915  6539.55100       -0.75497576 0.3041855 -2.48195841
## 52: ELEN_RS00230   423.50317       -0.06804533 0.2380475 -0.28584769
## 53: ELEN_RS08450  1470.08972       -0.43589240 0.4708735 -0.92571022
## 54: ELEN_RS12430  4081.27198       -0.21163823 0.1600358 -1.32244301
## 55: ELEN_RS16170   156.65462        0.06511662 0.3456763  0.18837456
## 56: ELEN_RS00250   150.32990       -0.04692105 0.2456875 -0.19097856
## 57: ELEN_RS14635  1633.45634       -0.82325305 0.2648058 -3.10889382
## 58: ELEN_RS07810  1583.69326       -0.31469607 0.2161371 -1.45600198
## 59: ELEN_RS08415 74851.84754       -0.39647252 0.2204226 -1.79869281
## 60: ELEN_RS08990   152.15450       -0.32005104 0.2356906 -1.35792855
## 61: ELEN_RS13895   357.42828       -0.15043329 0.1729046 -0.87003651
## 62: ELEN_RS10395  8654.05560       -0.60081754 0.2852704 -2.10613373
## 63: ELEN_RS01775   158.13069       -0.40877923 0.2479976 -1.64831944
## 64: ELEN_RS05200  6256.40295       -0.38389648 0.2195946 -1.74820573
##             Gene baseMean_Ac log2FoldChange_Ac  lfcSE_Ac     stat_Ac
##       pvalue_Ac   padj_Ac baseMean_Agm log2FoldChange_Agm lfcSE_Agm   stat_Agm
##  1: 0.267036110 0.9689222  26646.37979         -2.3023445 0.1762291 -13.064496
##  2: 0.667916142 0.9870812   3177.87185         -1.4811133 0.1628498  -9.094965
##  3: 0.489192298 0.9698422   1250.93435         -1.4556460 0.2140414  -6.800770
##  4: 0.491788849 0.9698422   4904.24380         -0.9115826 0.1474996  -6.180236
##  5: 0.410098163 0.9689222   4196.85545         -1.5368818 0.2889483  -5.318882
##  6: 0.155725027 0.9482795   2306.17402         -1.7392915 0.3347954  -5.195088
##  7: 0.294043056 0.9689222   9752.29806         -0.9618693 0.1984023  -4.848075
##  8: 0.291997875 0.9689222  11471.64459         -1.0075975 0.2123999  -4.743870
##  9: 0.010757230 0.5102237    449.98628         -1.3584856 0.2870814  -4.732057
## 10: 0.040615444 0.7588934   1129.39297         -1.6325837 0.3545756  -4.604332
## 11: 0.969054691 0.9920493   9382.59197         -1.6528148 0.3620191  -4.565546
## 12: 0.061300477 0.8111132    989.30443         -1.7128618 0.3809703  -4.496051
## 13: 0.127599899 0.9440227    458.06458         -0.7749561 0.1766259  -4.387556
## 14: 0.570749289 0.9736222   1232.01089         -0.6802919 0.1569036  -4.335732
## 15: 0.153522985 0.9482795  16364.92983         -1.6576492 0.3856481  -4.298347
## 16: 0.901381736 0.9870812   1047.01955         -1.1233783 0.2628778  -4.273386
## 17: 0.050442488 0.8024286    812.21548         -1.6611616 0.3941440  -4.214606
## 18: 0.383725270 0.9689222   1155.60437         -0.7406952 0.1769611  -4.185638
## 19: 0.819045313 0.9870812    197.35820         -0.9153231 0.2192087  -4.175578
## 20: 0.001111871 0.2016410    823.57486         -0.8636371 0.2165470  -3.988220
## 21: 0.034944824 0.7138106   1590.11793         -0.6043659 0.1527317  -3.957044
## 22: 0.921077654 0.9870812   2755.41982         -1.2375302 0.3135154  -3.947271
## 23: 0.528378532 0.9736222   5095.43554         -0.6547220 0.1682937  -3.890354
## 24: 0.841116814 0.9870812   4498.87774         -0.4668928 0.1225861  -3.808693
## 25: 0.114417634 0.9206440   2476.66450         -1.8254478 0.4855547  -3.759510
## 26: 0.383661972 0.9689222    888.85835         -0.5848712 0.1558939  -3.751725
## 27: 0.284457499 0.9689222   1485.30285         -0.4885490 0.1309806  -3.729934
## 28: 0.375598481 0.9689222   1878.69665         -0.4928417 0.1331552  -3.701258
## 29: 0.196810050 0.9542091  11083.53088         -0.6970119 0.1891723  -3.684535
## 30: 0.003691325 0.3552853    545.58869         -0.8638181 0.2349478  -3.676639
## 31: 0.199064924 0.9542091     52.56469         -1.3699168 0.3733597  -3.669161
## 32: 0.425847856 0.9689222    493.54873         -1.2714406 0.3516787  -3.615348
## 33: 0.005534120 0.3967836    828.93378         -0.6551113 0.1838152  -3.563967
## 34: 0.877779288 0.9870812   1201.58279         -0.5369896 0.1539856  -3.487270
## 35: 0.668787228 0.9870812    146.71784         -0.9928349 0.2870502  -3.458750
## 36: 0.428069991 0.9689222    179.83207         -0.9843163 0.2852893  -3.450239
## 37: 0.593234747 0.9736222    844.00385         -0.7889101 0.2311270  -3.413319
## 38: 0.238906116 0.9689222    567.54726         -0.6998988 0.2049846  -3.414396
## 39: 0.562622356 0.9736222   5996.21729         -0.6263468 0.1829180  -3.424193
## 40: 0.921003093 0.9870812   2598.12134         -1.0073075 0.3028969  -3.325579
## 41: 0.406116187 0.9689222    789.77241         -0.8251599 0.2495709  -3.306314
## 42: 0.075714345 0.8436144  17810.71321         -0.6578437 0.2026164  -3.246744
## 43: 0.276045593 0.9689222   9124.54158         -0.8287271 0.2563784  -3.232438
## 44: 0.199153603 0.9542091    288.02707         -0.8219510 0.2573721  -3.193629
## 45: 0.137668936 0.9482795  18782.44810         -0.7663676 0.2418604  -3.168637
## 46: 0.861471473 0.9870812  11522.55028         -0.7631157 0.2421160  -3.151859
## 47: 0.006132347 0.4110006   4153.04572         -0.5501047 0.1763666  -3.119098
## 48: 0.208853446 0.9605397   2181.84115         -0.9809596 0.3163641  -3.100730
## 49: 0.128512901 0.9440227  10685.98938         -0.9896650 0.3205569  -3.087331
## 50: 0.029445202 0.6918974   1636.55576         -0.7594253 0.2539206  -2.990798
## 51: 0.013066252 0.5193054   6539.55100         -0.9082625 0.3042226  -2.985520
## 52: 0.774994780 0.9870812    423.50317         -0.7116782 0.2400263  -2.965001
## 53: 0.354596593 0.9689222   1470.08972         -1.3944220 0.4714683  -2.957616
## 54: 0.186020675 0.9502169   4081.27198         -0.4741335 0.1601799  -2.960006
## 55: 0.850583040 0.9870812    156.65462         -1.0392441 0.3518629  -2.953548
## 56: 0.848542391 0.9870812    150.32990         -0.7359611 0.2513349  -2.928209
## 57: 0.001877892 0.2517192   1633.45634         -0.7575930 0.2648095  -2.860898
## 58: 0.145392071 0.9482795   1583.69326         -0.6162766 0.2164616  -2.847048
## 59: 0.072067287 0.8294639  74851.84754         -0.6258209 0.2204277  -2.839121
## 60: 0.174486357 0.9482795    152.15450         -0.6792657 0.2391670  -2.840131
## 61: 0.384280453 0.9689222    357.42828         -0.4892374 0.1746219  -2.801695
## 62: 0.035192738 0.7138106   8654.05560         -0.7959787 0.2853054  -2.789918
## 63: 0.099287137 0.8976947    158.13069         -0.6954957 0.2506009  -2.775312
## 64: 0.080428411 0.8589229   6256.40295         -0.6089716 0.2196576  -2.772368
##       pvalue_Ac   padj_Ac baseMean_Agm log2FoldChange_Agm lfcSE_Agm   stat_Agm
##       pvalue_Agm     padj_Agm baseMean_Arg log2FoldChange_Arg lfcSE_Arg
##  1: 5.253166e-39 2.133536e-36  26646.37979       -0.195743570 0.1760048
##  2: 9.461723e-20 2.988853e-17   3177.87185        0.047308610 0.1617054
##  3: 1.040617e-11 2.113196e-09   1250.93435       -0.353331032 0.2123546
##  4: 6.400565e-10 1.137300e-07   4904.24380       -0.025895365 0.1470695
##  5: 1.044066e-07 1.290557e-05   4196.85545       -0.384176311 0.2885136
##  6: 2.046227e-07 2.423926e-05   2306.17402       -0.007527258 0.3339222
##  7: 1.246654e-06 1.222151e-04   9752.29806       -0.265504645 0.1982665
##  8: 2.096732e-06 1.987003e-04  11471.64459       -0.171515065 0.2122755
##  9: 2.222562e-06 2.038305e-04    449.98628       -0.903642297 0.2854253
## 10: 4.137917e-06 3.460028e-04   1129.39297        0.207358052 0.3529349
## 11: 4.981962e-06 3.934366e-04   9382.59197       -0.334277736 0.3618495
## 12: 6.922723e-06 5.179290e-04    989.30443        0.308736997 0.3790120
## 13: 1.146314e-05 8.147428e-04    458.06458       -0.091254584 0.1736885
## 14: 1.452762e-05 9.833813e-04   1232.01089       -0.153169077 0.1558750
## 15: 1.720770e-05 1.137709e-03  16364.92983        0.094105809 0.3855449
## 16: 1.925264e-05 1.243983e-03   1047.01955       -0.129526657 0.2615228
## 17: 2.502145e-05 1.580799e-03    812.21548       -0.771446980 0.3929608
## 18: 2.843659e-05 1.757505e-03   1155.60437       -0.424161806 0.1761934
## 19: 2.972310e-05 1.797931e-03    197.35820       -0.427595744 0.2143089
## 20: 6.657095e-05 3.625978e-03    823.57486       -0.614491507 0.2158520
## 21: 7.588301e-05 3.891357e-03   1590.11793       -0.226467762 0.1520290
## 22: 7.904710e-05 3.942647e-03   2755.41982       -0.848928913 0.3132663
## 23: 1.000980e-04 4.742977e-03   5095.43554       -0.022803654 0.1680346
## 24: 1.397034e-04 6.406079e-03   4498.87774       -0.125412675 0.1223285
## 25: 1.702463e-04 7.446311e-03   2476.66450        0.269976971 0.4848995
## 26: 1.756220e-04 7.565051e-03    888.85835       -0.637514193 0.1555947
## 27: 1.915298e-04 8.056669e-03   1485.30285        0.339792504 0.1296856
## 28: 2.145336e-04 8.713129e-03   1878.69665        0.262393107 0.1322090
## 29: 2.291202e-04 9.174491e-03  11083.53088       -0.179196948 0.1890802
## 30: 2.363273e-04 9.331645e-03    545.58869       -0.886019332 0.2345480
## 31: 2.433476e-04 9.477221e-03     52.56469       -1.119173109 0.3653938
## 32: 2.999448e-04 1.122030e-02    493.54873       -0.635626734 0.3500802
## 33: 3.652919e-04 1.348734e-02    828.93378       -0.239445702 0.1827816
## 34: 4.879777e-04 1.691855e-02   1201.58279       -0.039081767 0.1529846
## 35: 5.426881e-04 1.794026e-02    146.71784       -0.318739833 0.2808034
## 36: 5.600913e-04 1.830275e-02    179.83207       -0.486815233 0.2811993
## 37: 6.417666e-04 1.973176e-02    844.00385       -0.673291440 0.2306096
## 38: 6.392356e-04 1.973176e-02    567.54726       -0.143868625 0.2032507
## 39: 6.166274e-04 1.973176e-02   5996.21729        0.172783964 0.1826816
## 40: 8.823519e-04 2.559721e-02   2598.12134       -0.378390918 0.3025638
## 41: 9.453210e-04 2.714694e-02    789.77241       -0.093560384 0.2482650
## 42: 1.167335e-03 3.245707e-02  17810.71321       -0.398073263 0.2025820
## 43: 1.227389e-03 3.323302e-02   9124.54158       -0.298115373 0.2562907
## 44: 1.404965e-03 3.768223e-02    288.02707       -0.302677881 0.2546885
## 45: 1.531556e-03 3.994692e-02  18782.44810       -0.046998888 0.2418069
## 46: 1.622344e-03 4.168795e-02  11522.55028       -0.298432236 0.2420472
## 47: 1.814053e-03 4.491806e-02   4153.04572       -0.136093851 0.1761585
## 48: 1.930444e-03 4.611978e-02   2181.84115       -0.452497896 0.3160558
## 49: 2.019629e-03 4.784837e-02  10685.98938       -0.386084664 0.3204898
## 50: 2.782496e-03 6.319391e-02   1636.55576        1.188531766 0.2526163
## 51: 2.830968e-03 6.337355e-02   6539.55100       -0.192847266 0.3041018
## 52: 3.026821e-03 6.670738e-02    423.50317       -0.136335443 0.2379212
## 53: 3.100285e-03 6.714943e-02   1470.08972        0.342062626 0.4706068
## 54: 3.076328e-03 6.714943e-02   4081.27198        0.056401663 0.1599023
## 55: 3.141433e-03 6.714943e-02    156.65462       -0.425806074 0.3471016
## 56: 3.409206e-03 7.068496e-02    150.32990       -0.155548135 0.2455913
## 57: 4.224425e-03 8.340306e-02   1633.45634       -0.772440417 0.2646922
## 58: 4.412673e-03 8.592622e-02   1583.69326        0.088037894 0.2157967
## 59: 4.523794e-03 8.689965e-02  74851.84754       -0.372475101 0.2204204
## 60: 4.509501e-03 8.689965e-02    152.15450        0.015860869 0.2328678
## 61: 5.083490e-03 9.384651e-02    357.42828       -0.261065820 0.1728490
## 62: 5.272134e-03 9.610539e-02   8654.05560        0.022737609 0.2852003
## 63: 5.514879e-03 9.860881e-02    158.13069       -0.183861480 0.2459499
## 64: 5.565003e-03 9.888315e-02   6256.40295       -0.079436027 0.2195228
##       pvalue_Agm     padj_Agm baseMean_Arg log2FoldChange_Arg lfcSE_Arg
##        stat_Arg   pvalue_Arg     padj_Arg                 ID            Parent
##  1: -1.11214911 2.660740e-01 0.9981163489 cds-WP_015760638.1 gene-ELEN_RS07845
##  2:  0.29256043 7.698582e-01 0.9981163489 cds-WP_015760639.1 gene-ELEN_RS07850
##  3: -1.66387289 9.613783e-02 0.9253325634 cds-WP_012809458.1 gene-ELEN_RS00110
##  4: -0.17607569 8.602345e-01 0.9981163489 cds-WP_015760346.1 gene-ELEN_RS05065
##  5: -1.33157110 1.830012e-01 0.9953376328 cds-WP_114518157.1 gene-ELEN_RS13660
##  6: -0.02254195 9.820156e-01 0.9981163489 cds-WP_015760717.1 gene-ELEN_RS08445
##  7: -1.33913006 1.805283e-01 0.9953376328 cds-WP_009305370.1 gene-ELEN_RS15110
##  8: -0.80798344 4.191001e-01 0.9981163489 cds-WP_009305371.1 gene-ELEN_RS15115
##  9: -3.16595053 1.545771e-03 0.0988457743 cds-WP_009305227.1 gene-ELEN_RS14380
## 10:  0.58752495 5.568512e-01 0.9981163489 cds-WP_015760714.1 gene-ELEN_RS08430
## 11: -0.92380327 3.555888e-01 0.9981163489 cds-WP_015761382.1 gene-ELEN_RS13655
## 12:  0.81458361 4.153107e-01 0.9981163489 cds-WP_015760715.1 gene-ELEN_RS08435
## 13: -0.52539234 5.993105e-01 0.9981163489 cds-WP_009608922.1 gene-ELEN_RS00245
## 14: -0.98264064 3.257843e-01 0.9981163489 cds-WP_015761098.1 gene-ELEN_RS11680
## 15:  0.24408519 8.071648e-01 0.9981163489 cds-WP_009307103.1 gene-ELEN_RS08455
## 16: -0.49527869 6.204034e-01 0.9981163489 cds-WP_012809457.1 gene-ELEN_RS00105
## 17: -1.96316542 4.962696e-02 0.7431479548 cds-WP_009608029.1 gene-ELEN_RS01380
## 18: -2.40736466 1.606812e-02 0.4472753563 cds-WP_009304771.1 gene-ELEN_RS05460
## 19: -1.99523111 4.601768e-02 0.7210452321 cds-WP_009609092.1 gene-ELEN_RS14275
## 20: -2.84681809 4.415859e-03 0.2043700204 cds-WP_015760951.1 gene-ELEN_RS10480
## 21: -1.48963506 1.363202e-01 0.9880657129 cds-WP_015761214.1 gene-ELEN_RS12450
## 22: -2.70992768 6.729788e-03 0.2810658175 cds-WP_015761381.1 gene-ELEN_RS13650
## 23: -0.13570812 8.920520e-01 0.9981163489 cds-WP_015759952.1 gene-ELEN_RS01930
## 24: -1.02521225 3.052631e-01 0.9981163489 cds-WP_015761007.1 gene-ELEN_RS11095
## 25:  0.55676892 5.776853e-01 0.9981163489 cds-WP_015760716.1 gene-ELEN_RS08440
## 26: -4.09727348 4.180449e-05 0.0076084176 cds-WP_009304827.1 gene-ELEN_RS05170
## 27:  2.62012437 8.789770e-03 0.3120703781 cds-WP_015759967.1 gene-ELEN_RS02115
## 28:  1.98468400 4.717964e-02 0.7300388456 cds-WP_009306026.1 gene-ELEN_RS02110
## 29: -0.94772977 3.432670e-01 0.9981163489 cds-WP_015759796.1 gene-ELEN_RS00365
## 30: -3.77756114 1.583716e-04 0.0197214359 cds-WP_015759865.1 gene-ELEN_RS00970
## 31: -3.06292301 2.191864e-03           NA cds-WP_015761097.1 gene-ELEN_RS11675
## 32: -1.81566044 6.942248e-02 0.8578723247 cds-WP_015760322.1 gene-ELEN_RS04880
## 33: -1.31000972 1.901925e-01 0.9953376328 cds-WP_015761209.1 gene-ELEN_RS12420
## 34: -0.25546213 7.983662e-01 0.9981163489 cds-WP_015760634.1 gene-ELEN_RS07805
## 35: -1.13509972 2.563335e-01 0.9981163489 cds-WP_015760708.1 gene-ELEN_RS08385
## 36: -1.73121055 8.341422e-02 0.9221619347 cds-WP_015759782.1 gene-ELEN_RS00235
## 37: -2.91961646 3.504624e-03 0.1771943537 cds-WP_015759837.1 gene-ELEN_RS00795
## 38: -0.70783815 4.790458e-01 0.9981163489 cds-WP_009304435.1 gene-ELEN_RS07100
## 39:  0.94582032 3.442402e-01 0.9981163489 cds-WP_114522560.1 gene-ELEN_RS09105
## 40: -1.25061539 2.110748e-01 0.9981163489 cds-WP_009306609.1 gene-ELEN_RS12445
## 41: -0.37685688 7.062800e-01 0.9981163489 cds-WP_009307213.1 gene-ELEN_RS09100
## 42: -1.96499772 4.941450e-02 0.7431479548 cds-WP_009307093.1 gene-ELEN_RS08410
## 43: -1.16319235 2.447515e-01 0.9981163489 cds-WP_015761430.1 gene-ELEN_RS14280
## 44: -1.18842365 2.346665e-01 0.9981163489 cds-WP_035584369.1 gene-ELEN_RS00805
## 45: -0.19436536 8.458898e-01 0.9981163489 cds-WP_015760938.1 gene-ELEN_RS10390
## 46: -1.23295050 2.175942e-01 0.9981163489 cds-WP_015761433.1 gene-ELEN_RS14295
## 47: -0.77256457 4.397801e-01 0.9981163489 cds-WP_015760952.1 gene-ELEN_RS10490
## 48: -1.43170271 1.522289e-01 0.9880657129 cds-WP_009608875.1 gene-ELEN_RS05465
## 49: -1.20467058 2.283305e-01 0.9981163489 cds-WP_015761431.1 gene-ELEN_RS14285
## 50:  4.70488938 2.540036e-06 0.0006456412 cds-WP_009607771.1 gene-ELEN_RS11070
## 51: -0.63415355 5.259806e-01 0.9981163489 cds-WP_015760785.1 gene-ELEN_RS08915
## 52: -0.57302763 5.666260e-01 0.9981163489 cds-WP_015759781.1 gene-ELEN_RS00230
## 53:  0.72685442 4.673151e-01 0.9981163489 cds-WP_015760718.1 gene-ELEN_RS08450
## 54:  0.35272572 7.242941e-01 0.9981163489 cds-WP_015761211.1 gene-ELEN_RS12430
## 55: -1.22674777 2.199174e-01 0.9981163489 cds-WP_143924742.1 gene-ELEN_RS16170
## 56: -0.63336174 5.264974e-01 0.9981163489 cds-WP_009608952.1 gene-ELEN_RS00250
## 57: -2.91825872 3.519922e-03 0.1771943537 cds-WP_009305281.1 gene-ELEN_RS14635
## 58:  0.40796675 6.832981e-01 0.9981163489 cds-WP_015760635.1 gene-ELEN_RS07810
## 59: -1.68983963 9.105864e-02 0.9221619347 cds-WP_143924739.1 gene-ELEN_RS08415
## 60:  0.06811104 9.456972e-01 0.9981163489 cds-WP_009609235.1 gene-ELEN_RS08990
## 61: -1.51036953 1.309492e-01 0.9880657129 cds-WP_015761404.1 gene-ELEN_RS13895
## 62:  0.07972506 9.364559e-01 0.9981163489 cds-WP_035585969.1 gene-ELEN_RS10395
## 63: -0.74755668 4.547276e-01 0.9981163489 cds-WP_015759928.1 gene-ELEN_RS01775
## 64: -0.36185769 7.174584e-01 0.9981163489 cds-WP_015760365.1 gene-ELEN_RS05200
##        stat_Arg   pvalue_Arg     padj_Arg                 ID            Parent
##            Name2
##  1: ELEN_RS07845
##  2: ELEN_RS07850
##  3: ELEN_RS00110
##  4: ELEN_RS05065
##  5: ELEN_RS13660
##  6:         yedF
##  7: ELEN_RS15110
##  8: ELEN_RS15115
##  9: ELEN_RS14380
## 10: ELEN_RS08430
## 11: ELEN_RS13655
## 12: ELEN_RS08435
## 13: ELEN_RS00245
## 14: ELEN_RS11680
## 15: ELEN_RS08455
## 16: ELEN_RS00105
## 17: ELEN_RS01380
## 18: ELEN_RS05460
## 19:         kdpA
## 20: ELEN_RS10480
## 21: ELEN_RS12450
## 22: ELEN_RS13650
## 23:         cimA
## 24: ELEN_RS11095
## 25: ELEN_RS08440
## 26: ELEN_RS05170
## 27: ELEN_RS02115
## 28:         porA
## 29: ELEN_RS00365
## 30: ELEN_RS00970
## 31: ELEN_RS11675
## 32: ELEN_RS04880
## 33: ELEN_RS12420
## 34:         hemH
## 35: ELEN_RS08385
## 36: ELEN_RS00235
## 37: ELEN_RS00795
## 38: ELEN_RS07100
## 39: ELEN_RS09105
## 40: ELEN_RS12445
## 41: ELEN_RS09100
## 42: ELEN_RS08410
## 43: ELEN_RS14280
## 44: ELEN_RS00805
## 45:         cobA
## 46: ELEN_RS14295
## 47: ELEN_RS10490
## 48: ELEN_RS05465
## 49: ELEN_RS14285
## 50: ELEN_RS11070
## 51: ELEN_RS08915
## 52:         tadA
## 53: ELEN_RS08450
## 54: ELEN_RS12430
## 55: ELEN_RS16170
## 56: ELEN_RS00250
## 57: ELEN_RS14635
## 58:        coaBC
## 59: ELEN_RS08415
## 60: ELEN_RS08990
## 61: ELEN_RS13895
## 62:         hemC
## 63: ELEN_RS01775
## 64:         atpG
##            Name2
##                                                                                               product
##  1:                                                                               YfcC family protein
##  2:                                                                    MATE family efflux transporter
##  3:                                                                              hypothetical protein
##  4:                                                           sodium:alanine symporter family protein
##  5:                                                                              hypothetical protein
##  6:                                           sulfurtransferase-like selenium metabolism protein YedF
##  7:                                                    demethoxyubiquinone hydroxylase family protein
##  8:                                                                        bacteriocin family protein
##  9:                                                                          TIGR03987 family protein
## 10:                                                                     acyl-CoA dehydratase activase
## 11:                                                                       RNA polymerase sigma factor
## 12:                                                                 DUF3343 domain-containing protein
## 13:                           prepilin-type N-terminal cleavage/methylation domain-containing protein
## 14:                                                           uracil-xanthine permease family protein
## 15:                                                      2-hydroxyacyl-CoA dehydratase family protein
## 16:                                                                              hypothetical protein
## 17:                                                                                   MFS transporter
## 18:                                                                            DUF6110 family protein
## 19:                                                        potassium-transporting ATPase subunit KdpA
## 20:                                                         cytochrome b/b6 domain-containing protein
## 21:                                                                              deoxyribonuclease IV
## 22:                                                                              hypothetical protein
## 23:                                                                              citramalate synthase
## 24:                                                               L%2CD-transpeptidase family protein
## 25:                                                aminotransferase class V-fold PLP-dependent enzyme
## 26:                                                                              hypothetical protein
## 27:                                          2-ketoisovalerate ferredoxin oxidoreductase subunit beta
## 28:                                         2-ketoisovalerate ferredoxin oxidoreductase subunit alpha
## 29:                                                                           sodium/solute symporter
## 30:                                                                 DUF2871 domain-containing protein
## 31:                                                                                VOC family protein
## 32:                                                                                cold-shock protein
## 33:                                                                              hypothetical protein
## 34:                                                                                    ferrochelatase
## 35:                                                  LPXTG cell wall anchor domain-containing protein
## 36:                                                             PilT/PilU family type 4a pilus ATPase
## 37:                                                        helix-turn-helix domain-containing protein
## 38:                                                          CpsD/CapB family tyrosine-protein kinase
## 39:                                                                       M60 family metallopeptidase
## 40:                                                                              C39 family peptidase
## 41:                                                                              hypothetical protein
## 42:                                                                            4Fe-4S binding protein
## 43:                                                                              hypothetical protein
## 44:                                       type 1 glutamine amidotransferase domain-containing protein
## 45:                                                          uroporphyrinogen-III C-methyltransferase
## 46:                                                                       leucine-rich repeat protein
## 47:                                                                aldehyde ferredoxin oxidoreductase
## 48:                                                           heavy metal translocating P-type ATPase
## 49:                                                                              hypothetical protein
## 50:                                                                          ABC transporter permease
## 51:                                                                           phosphoglycerate kinase
## 52:                                                               type II/IV secretion system protein
## 53:                                                                 DUF3343 domain-containing protein
## 54:                                                                            aldehyde dehydrogenase
## 55:                                                                              hypothetical protein
## 56:                                                                              A24 family peptidase
## 57:                                                           molecular chaperone TorD family protein
## 58: bifunctional phosphopantothenoylcysteine decarboxylase/phosphopantothenate--cysteine ligase CoaBC
## 59:                                                            molybdopterin-dependent oxidoreductase
## 60:                                                                  DUF188 domain-containing protein
## 61:                                                        helix-turn-helix transcriptional regulator
## 62:                                                                      hydroxymethylbilane synthase
## 63:                                                                   GNAT family N-acetyltransferase
## 64:                                                                     ATP synthase F1 subunit gamma
##                                                                                               product
##                                                                                                                   old_locus_tag
##  1:                                                                                                                   Elen_1568
##  2:                                                                                                                   Elen_1569
##  3:                                                                                                                   Elen_0018
##  4:                                                                                                                   Elen_1016
##  5:                                                                                                                   Elen_2729
##  6:                                                                                                                   Elen_1688
##  7:                                                                                                                   Elen_3017
##  8:                                                                                                                   Elen_3018
##  9:                                                                                                                   Elen_2868
## 10:                                                                                                                   Elen_1685
## 11:                                                                                                                   Elen_2728
## 12:                                                                                                                   Elen_1686
## 13:                                                                                                                   Elen_0045
## 14:                                                                                                                   Elen_2327
## 15:                                                                                                                   Elen_1690
## 16:                                                                                                                   Elen_0017
## 17:                                                                                                                   Elen_0267
## 18:                                                                                                                   Elen_1097
## 19:                                                                                                                   Elen_2846
## 20:                                                                                                                   Elen_2087
## 21:                                                                                                                   Elen_2483
## 22:                                                                                                                   Elen_2727
## 23:                                                                                                                   Elen_0380
## 24:                                                                                                                   Elen_2208
## 25:                                                                                                                   Elen_1687
## 26:                                                                                                                   Elen_1038
## 27:                                                                                                                   Elen_0418
## 28:                                                                                                                   Elen_0417
## 29:                                                                                                                   Elen_0068
## 30:                                                                                                                   Elen_0185
## 31:                                                                                                                   Elen_2326
## 32:                                                                                                                   Elen_0979
## 33:                                                                                                                   Elen_2477
## 34:                                                                                                                   Elen_1561
## 35:                                                                                                                   Elen_1676
## 36:                                                                                                                   Elen_0043
## 37:                                                                                                                   Elen_0150
## 38:                                                                                                                   Elen_1420
## 39:                                                                                                                   Elen_1817
## 40:                                                                                                                   Elen_2482
## 41:                                                                                                                   Elen_1816
## 42:                                                                                                                   Elen_1681
## 43:                                                                                                                   Elen_2849
## 44:                                                                                                                   Elen_0152
## 45:                                                                                                                   Elen_2069
## 46:                                                                                                                   Elen_2852
## 47:                                                                                                                   Elen_2089
## 48:                                                                                                                   Elen_1098
## 49:                                                                                                                   Elen_2850
## 50:                                                                                                                   Elen_2202
## 51:                                                                                                                   Elen_1778
## 52:                                                                                                                   Elen_0042
## 53:                                                                                                                   Elen_1689
## 54:                                                                                                                   Elen_2479
## 55: ID=gene-ELEN_RS16170;Dbxref=GeneID:40923971;Name=ELEN_RS16170;gbkey=Gene;gene_biotype=protein_coding;locus_tag=ELEN_RS16170
## 56:                                                                                                                   Elen_0046
## 57:                                                                                                                   Elen_2920
## 58:                                                                                                                   Elen_1562
## 59:                                                                                                                   Elen_1682
## 60:                                                                                                                   Elen_1794
## 61:                                                                                                                   Elen_2775
## 62:                                                                                                                   Elen_2070
## 63:                                                                                                                   Elen_0348
## 64:                                                                                                                   Elen_1044
##                                                                                                                   old_locus_tag
results_all3[,Name3:=ifelse(Name2 == Gene, Gene, paste0(Name2, rank(Gene))), by = Name2]
top_agm_genes <- results_all3[order(padj_Agm)][1:15]

### Agmatine volcano plot
volc_plot <- ggplot(results_all3, aes(x = log2FoldChange_Agm, y= -1*log10(padj_Agm))) + geom_vline(xintercept = -1, linetype = 2, color = "gray30") +
  geom_vline(xintercept = 1, linetype = 2, color = "gray30") + geom_hline(yintercept = 2, linetype = 2, color = "gray30") +
  geom_point(size = 1.5, shape = 21, aes(fill = ifelse(padj_Agm < 0.01 & abs(log2FoldChange_Agm) > 1, TRUE, FALSE))) + scale_fill_manual(values = c("gray50", "#f05c64")) + geom_text_repel(aes(label = Name3), data = results_all3[log10(padj_Agm) < -60], size = 3) + ylab("-log10(FDR-adj p-value)") + xlab("log2 fold change Agm/Ctrl") + guides(fill = "none")

ggsave(volc_plot, file = paste0(outdir, "agmatine_volcano_plot.pdf"), width = 3, height = 2.6)

volc_plot

##### Are arg biosynthesis genes upregulated?
results_all3[grepl("Elen_23[3-4][0-9]", old_locus_tag), list(Name2, product, log2FoldChange_Agm, pvalue_Agm, padj_Agm, log2FoldChange_Arg, pvalue_Arg, padj_Arg)]
##            Name2
##  1:         rplL
##  2:         rplJ
##  3: ELEN_RS11705
##  4:         acnA
##  5: ELEN_RS11715
##  6: ELEN_RS11720
##  7: ELEN_RS11725
##  8: ELEN_RS11730
##  9:         argH
## 10: ELEN_RS11740
## 11: ELEN_RS11745
## 12: ELEN_RS11750
## 13:         argB
## 14:         argJ
## 15:         argC
## 16: ELEN_RS11770
## 17: ELEN_RS11775
## 18: ELEN_RS11780
## 19: ELEN_RS11785
## 20: ELEN_RS11790
##                                                                          product
##  1:                                                 50S ribosomal protein L7/L12
##  2:                                                    50S ribosomal protein L10
##  3:                                                         hypothetical protein
##  4:                                                     aconitate hydratase AcnA
##  5:                      isocitrate/isopropylmalate dehydrogenase family protein
##  6:                                                         hypothetical protein
##  7:                                                         hypothetical protein
##  8:                                                   penicillin-binding protein
##  9:                                                      argininosuccinate lyase
## 10:                                                   argininosuccinate synthase
## 11:                                        ArgR family transcriptional regulator
## 12:         aminotransferase class III-fold pyridoxal phosphate-dependent enzyme
## 13:                                                       acetylglutamate kinase
## 14: bifunctional glutamate N-acetyltransferase/amino-acid acetyltransferase ArgJ
## 15:                                  N-acetyl-gamma-glutamyl-phosphate reductase
## 16:                        type II toxin-antitoxin system RelE/ParE family toxin
## 17:           type II toxin-antitoxin system prevent-host-death family antitoxin
## 18:                                          polysaccharide biosynthesis protein
## 19:                                                   glutamate--cysteine ligase
## 20:                                FKBP-type peptidyl-prolyl cis-trans isomerase
##     log2FoldChange_Agm pvalue_Agm  padj_Agm log2FoldChange_Arg pvalue_Arg
##  1:        -0.04852633 0.86758947 0.9678304        -0.09571386 0.74226322
##  2:        -0.11525771 0.75253564 0.9320971        -0.22127932 0.54495779
##  3:         0.10281248 0.59100450 0.8734596         0.11836123 0.53607079
##  4:        -0.30181144 0.30940659 0.7277248        -0.00283489 0.99237916
##  5:        -0.15129354 0.41043058 0.7900316         0.11532338 0.52921164
##  6:         0.06074491 0.75492342 0.9327947         0.04012380 0.83659867
##  7:         0.45077147 0.02750982 0.2763619         0.07319728 0.72050449
##  8:         0.35502080 0.09914362 0.4977875         0.16897885 0.43251776
##  9:        -0.41629155 0.09298702 0.4882199        -0.16582683 0.49888476
## 10:        -0.13117908 0.65750172 0.8986835        -0.19207823 0.51569075
## 11:        -0.00362817 0.98903126 0.9992284         0.29113465 0.26955308
## 12:        -0.28688224 0.33752810 0.7458835         0.07922107 0.79088137
## 13:        -0.06946638 0.70022669 0.9115375        -0.07872523 0.66224727
## 14:        -0.29791594 0.27042271 0.7071160         0.15219279 0.57260319
## 15:        -0.30716313 0.35125282 0.7541857         0.03797653 0.90816145
## 16:         0.36815472 0.10997926 0.5171208         0.43991200 0.05575168
## 17:         0.25197056 0.33733143 0.7458835         0.43785387 0.09442164
## 18:        -0.10627773 0.49784841 0.8357135         0.02471034 0.87447831
## 19:        -0.17856166 0.42058406 0.7934442        -0.21046763 0.34208565
## 20:        -0.36569214 0.09274051 0.4882199        -0.27939857 0.19669828
##      padj_Arg
##  1: 0.9981163
##  2: 0.9981163
##  3: 0.9981163
##  4: 0.9981163
##  5: 0.9981163
##  6: 0.9981163
##  7: 0.9981163
##  8: 0.9981163
##  9: 0.9981163
## 10: 0.9981163
## 11: 0.9981163
## 12: 0.9981163
## 13: 0.9981163
## 14: 0.9981163
## 15: 0.9981163
## 16: 0.7851695
## 17: 0.9253326
## 18: 0.9981163
## 19: 0.9981163
## 20: 0.9981163
##### Save table of DE genes
top_agm_genes <- results_all3[padj_Agm < 0.1 & abs(log2FoldChange_Agm) > 1, list(Gene, baseMean_Agm, log2FoldChange_Agm,
                                                                                 lfcSE_Agm, stat_Agm, pvalue_Agm, padj_Agm, ID, Name2, product, old_locus_tag)][order(log2FoldChange_Agm, decreasing = T)]
top_agm_genes[grepl("ID=", old_locus_tag), old_locus_tag:=NA]
fwrite(top_agm_genes, file = paste0(outdir, "top_agmatine_DE_genes.txt"), quote=F, sep = "\t")

3.2 FBA analysis of agmatine media

######## FBA agmatine simulation

fba_dir <- "../../ElentaFBA/"
agm_fva <- fread(paste0(fba_dir, "DM1bAgm1Arg0_fva_fluxes_25559.txt"))
agm_pfba <- fread(paste0(fba_dir, "DM1bAgm1Arg0_pfba_fluxes_25559.txt"))
agm_pfba[,Rxn:=gsub("_[fb]$", "", Var1)]
agm_pfba[,Dir:=gsub(".*_", "", Var1)]
agm_pfba[!Dir %in% c("f", "b"), Dir:="f"]
agm_pfba <- dcast(agm_pfba, Rxn~Dir, value.var = "Var2", fill = 0)
agm_pfba[,value:=ifelse(f==0 & b != 0, -1*b, f)]
agm_pfba <- agm_pfba[Rxn != "fluxMeasure" & Rxn != "netFlux"]
agm_fva <- merge(agm_fva, agm_pfba[,list(Rxn, value)], by.x = "Var1", by.y = "Rxn", all = T)
rxn_names <- fread(paste0(fba_dir, "Elenta25559_rxnInfo.txt"))
agm_fva <- merge(agm_fva, rxn_names[,list(Var1, Var2)], by = "Var1", all = T)
setnames(agm_fva, c("Rxn", "Subsystem", "FVA_LB", "FVA_UB", "LB", "UB", "pFBA", "RxnName"))
agm_fva[Subsystem == "" | is.na(Subsystem) | Subsystem == "Unassigned" | Subsystem == "Miscellaneous", Subsystem:="Other"]
agm_fva[Subsystem == "Exchange", Subsystem:="Exchange/demand reaction"]
agm_fva[Subsystem == "Urea cycle", Subsystem:="Arginine and proline metabolism"]
agm_fva[grepl("t2r", Rxn)|grepl("t2", Rxn), Subsystem:="Transport, extracellular"]
agm_fva[order(abs(pFBA), decreasing = T)][1:30]
##             Rxn                                          Subsystem      FVA_LB
##  1:    EX_h2(e)                           Exchange/demand reaction   -57.85748
##  2:        H2td                           Transport, extracellular   -57.85748
##  3:     EX_h(e)                           Exchange/demand reaction   -50.78949
##  4:        POR4                                Pyruvate metabolism    28.65964
##  5: HYDFDN2rfdx                             Wood-Ljungdahl Pathway -1000.00000
##  6:      NAt3_1                           Transport, extracellular    23.03131
##  7: EX_pro_L(e)                           Exchange/demand reaction   -23.03052
##  8:      PROt4r                           Transport, extracellular    23.03052
##  9:        P5CD                               Glutamate metabolism    22.93165
## 10:      P5CRyr                    Arginine and proline metabolism  -977.06835
## 11:      ACONTa                                  Citric acid cycle   -22.53597
## 12:      ACONTb                                  Citric acid cycle   -22.53597
## 13:       ICDHx                                  Citric acid cycle -1000.00000
## 14:       OAASr                                  Citric acid cycle    22.53597
## 15:   EX_nh4(e)                           Exchange/demand reaction    14.68359
## 16:       NH4tb                           Transport, extracellular   -26.02414
## 17:        AGMD                    Arginine and proline metabolism    19.76200
## 18:   EX_agm(e)                           Exchange/demand reaction   -19.88928
## 19:        PCBT                    Arginine and proline metabolism    19.76200
## 20:     agm_t2r                           Transport, extracellular   -19.88928
## 21:  EX_ptrc(e)                           Exchange/demand reaction    19.76034
## 22:    ptrc_t2r                           Transport, extracellular    19.76034
## 23:       CBMKr                    Arginine and proline metabolism   -19.75697
## 24:       ATPS4                                        Respiration    13.24646
## 25:       ASPTA                   Alanine and aspartate metabolism   -10.96736
## 26:        PPCr                                Pyruvate metabolism  -988.29907
## 27:        ASAD Glycine, serine, alanine, and threonine metabolism   -10.61710
## 28:       ASPKi Glycine, serine, alanine, and threonine metabolism    10.61710
## 29:      DAPMDH                                  Folate metabolism   -10.24245
## 30:      DHDPRy                                  Lysine metabolism    10.11518
##             Rxn                                          Subsystem      FVA_LB
##         FVA_UB            LB   UB      pFBA
##  1:  -57.34838 -1.039406e+03 1000 -57.34838
##  2:  -57.34838 -1.000000e+03 1000 -57.34838
##  3:  -38.64700 -1.000000e+03 1000 -38.64700
##  4:   28.78692 -1.000000e+03 1000  28.65964
##  5:  971.34202 -1.000000e+03 1000 -27.12184
##  6:   23.03131 -1.000000e+03 1000  23.03131
##  7:  -23.03052 -2.303052e+01 1000 -23.03052
##  8:   23.03052 -1.000000e+03 1000  23.03052
##  9:   22.93165  0.000000e+00 1000  22.93165
## 10:   22.93165 -1.000000e+03 1000  22.93165
## 11:  -22.53597 -1.000000e+03 1000 -22.53597
## 12:  -22.53597 -1.000000e+03 1000 -22.53597
## 13:  -22.53597 -1.000000e+03 1000 -22.53597
## 14:   22.53597 -1.000000e+03 1000  22.53597
## 15:   26.02414 -1.164689e-03 1000  20.89036
## 16:  -14.68359 -1.000000e+03 1000 -20.89036
## 17:   19.88928  0.000000e+00 1000  19.76200
## 18:  -19.76200 -4.347589e+02 1000 -19.76200
## 19:   19.88928 -1.000000e+03 1000  19.76200
## 20:  -19.76200 -1.000000e+03 1000 -19.76200
## 21:   19.88761  0.000000e+00 1000  19.76034
## 22:   19.88761 -1.000000e+03 1000  19.76034
## 23:  -19.62969 -1.000000e+03 1000 -19.62969
## 24:   13.37373  0.000000e+00 1000  13.24646
## 25:  -10.96736 -1.000000e+03 1000 -10.96736
## 26: 1000.00000 -1.000000e+03 1000  10.78721
## 27:  -10.61710 -1.000000e+03 1000 -10.61710
## 28:   10.61710  0.000000e+00 1000  10.61710
## 29:  -10.11518 -1.000000e+03 1000 -10.24245
## 30:   10.24245  0.000000e+00 1000  10.24245
##         FVA_UB            LB   UB      pFBA
##                                                 RxnName
##  1:                                         H2 exchange
##  2:                                  hydrogen transport
##  3:                        exchange reaction for proton
##  4:     Pyruvate-flavodoxin oxidoreductase (EC 1.2.7.-)
##  5:                 Ferredoxin NADPH linked hydrogenase
##  6:              Sodium Proton Antiporter (H:Na Is 1:1)
##  7:                                  L-Proline exchange
##  8:                                 proline transporter
##  9:             1-pyrroline-5-carboxylate dehydrogenase
## 10:                     L-ProlineNADP+ 5-oxidoreductase
## 11:    aconitase (half-reaction A, Citrate hydro-lyase)
## 12: aconitase (half-reaction B, Isocitrate hydro-lyase)
## 13:                       isocitrate dehydrogenase NAD 
## 14:                   Oxaloacetate synthase, reversible
## 15:                                    Ammonia exchange
## 16:                           Transport of Ammonium ion
## 17:                                 Agmantine deiminase
## 18:                                           EX_agm[e]
## 19:                                                PCBT
## 20:                                             agm_t2r
## 21:                                          EX_ptrc[e]
## 22:                                            ptrc_t2r
## 23:                                    Carbamate kinase
## 24:             ATP synthase (four protons for one ATP)
## 25:                              Aspartate Transaminase
## 26:         phosphoenolpyruvate carboxylase, reversible
## 27:                aspartate-semialdehyde dehydrogenase
## 28:                      aspartate kinase, irreversible
## 29:                Meso-diaminopimelate D-dehydrogenase
## 30:                                              DHDPRy
##                                                 RxnName
agm_fva[Rxn == "bio1"]
##     Rxn Subsystem    FVA_LB    FVA_UB LB   UB      pFBA RxnName
## 1: bio1     Other 0.5363187 0.5363187  0 1000 0.5363187    bio1

KEGG annotations of strains

### KEGG annots - supplementary table
kegg_files <- list.files("../../../jbisanz/ElGenomes2019/annotation/kegg/", pattern = "Eggerthella_lenta_", full.names = T)
el_kegg_annot <- rbindlist(lapply(kegg_files, fread))
el_kegg_annot <- el_kegg_annot[KO %in% c("K13252", "K10536", "K00926")]
el_kegg_annot[,GenomeID:=case_when(
  grepl("DIAB165", GenomeID) ~ "Eggerthella_lenta_RJX1626",
  grepl("DIAB223", GenomeID) ~ "Eggerthella_lenta_RJX1627",
  TRUE ~ GenomeID
)]
el_kegg_annot[,GeneID:=gsub("DIAB165", "RJX1626", GeneID)]
el_kegg_annot[,GeneID:=gsub("DIAB223", "RJX1627", GeneID)]
el_kegg_annot <- nest(el_kegg_annot, cols = "GeneID")
el_kegg_annot[,NumGenes:=sapply(cols, nrow)]
el_kegg_annot[,AllGenesString:=sapply(cols, function(x){
  return(paste(x[,GeneID], collapse = ", "))
})]
el_kegg_annot_count <- melt(dcast(el_kegg_annot, GenomeID ~ KO, value.var = "NumGenes", fill = 0))

el_kegg_annot_tab <- dcast(el_kegg_annot, GenomeID~KO, value.var = c("AllGenesString", "NumGenes"))
el_kegg_annot_tab <- el_kegg_annot_tab[!grepl("MAG", GenomeID)]
fwrite(el_kegg_annot_tab, file = paste0(outdir, "kegg_agm_gene_annots.tsv"), quote=F, sep = "\t")